Skip to content

Commit f98aaf3

Browse files
sqlx bulk insert after running compiling codes
1 parent 5bcbcd8 commit f98aaf3

6 files changed

+28
-39
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DATABASE_URL = postgres://taslim:6318@localhost:5432/test

.sqlx/query-0d4e055d87b4496202041f3c28618688afa91dc0b8eeb8e551b271fc73c1157e.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-56c3678866ffe0ec2eed7290394d07007990cc244f598b763ec5470515efe019.json

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-6c365bc1b0728ec8d9f1239d7bffe7861ff17c6b8de4365a39f28099f5711613.json

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
DROP TABLE IF EXISTS scalar_tap_ravs CASCADE;
2-
DROP TABLE IF EXISTS scalar_tap_rav_requests_failed CASCADE;
1+
-- DROP TABLE IF EXISTS scalar_tap_ravs CASCADE;
2+
-- DROP TABLE IF EXISTS scalar_tap_rav_requests_failed CASCADE;

tap-agent/src/agent/sender_allocation.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ impl SenderAllocationState {
693693
let mut nounces = Vec::with_capacity(reciepts_len);
694694
let mut values = Vec::with_capacity(reciepts_len);
695695

696-
for received_receipt in receipts.iter(){
696+
for received_receipt in receipts.iter() {
697697
let receipt = received_receipt.signed_receipt();
698698
let allocation_id = receipt.message.allocation_id;
699699
let encoded_signature = receipt.signature.as_bytes().to_vec();
@@ -704,12 +704,6 @@ impl SenderAllocationState {
704704
error!("Failed to recover receipt signer: {}", e);
705705
anyhow!(e)
706706
})?;
707-
debug!(
708-
"Receipt for allocation {} and signer {} failed reason: {}",
709-
allocation_id.encode_hex(),
710-
receipt_signer.encode_hex(),
711-
receipt_error
712-
);
713707
reciepts_signers.push(receipt_signer.encode_hex());
714708
encoded_signatures.push(encoded_signature);
715709
allocation_ids.push(allocation_id.encode_hex());
@@ -733,13 +727,14 @@ impl SenderAllocationState {
733727
$5::NUMERIC(20)[],
734728
$6::NUMERIC(40)[]
735729
)"#,
736-
&signers,
737-
&signatures,
730+
&reciepts_signers,
731+
&encoded_signatures,
738732
&allocation_ids,
739733
&timestamps,
740-
&nonces,
734+
&nounces,
741735
&values,
742-
).execute(&self.pgpool)
736+
)
737+
.execute(&self.pgpool)
743738
.await
744739
.map_err(|e| {
745740
error!("Failed to store receipt: {}", e);

0 commit comments

Comments
 (0)