Skip to content

Commit

Permalink
handle submit errors
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Dec 6, 2024
1 parent a3f8591 commit da140d4
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions src/analytics/enrich_account_funding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,25 @@ impl BalanceTracker {
let data = self.to_cypher_map(*id)?;
let query_literal = generate_cypher_query(data);
let query = Query::new(query_literal);
let mut result = pool.execute(query).await?;

while let Some(r) = result.next().await? {
if let Ok(i) = r.get::<u64>("merged_relations") {
trace!("merged ledger in tx: {i}");
merged_relations += i;
};
let result = pool.execute(query).await;

match result {
Ok(mut d) => {
while let r = d.next().await.ok() {
match r {
Ok(row) => {

Check failure on line 205 in src/analytics/enrich_account_funding.rs

View workflow job for this annotation

GitHub Actions / clippy

mismatched types

Check failure on line 205 in src/analytics/enrich_account_funding.rs

View workflow job for this annotation

GitHub Actions / clippy

mismatched types
if let Some(r) = row {
if let Ok(i) = r.get::<u64>("merged_relations") {
trace!("merged ledger in tx: {i}");
merged_relations += i;
};
}
}
Err(e) => error!("could not parse row in cypher query response: {}", e),

Check failure on line 213 in src/analytics/enrich_account_funding.rs

View workflow job for this annotation

GitHub Actions / clippy

mismatched types

Check failure on line 213 in src/analytics/enrich_account_funding.rs

View workflow job for this annotation

GitHub Actions / clippy

mismatched types
}
}
}
Err(e) => error!("could not get response in cypher query response: {}", e),
}
}
Ok(merged_relations)
Expand Down

0 comments on commit da140d4

Please sign in to comment.