Skip to content

Commit

Permalink
chore: flush db cache on input miss
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr committed Jul 5, 2024
1 parent 5522772 commit 0b1d51c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/db/cache/index_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::{
db_ledger_operation::DbLedgerOperation, db_rune::DbRune,
db_supply_change::DbSupplyChange,
},
pg_get_max_rune_number, pg_get_input_rune_balances, pg_get_rune_by_id,
pg_get_input_rune_balances, pg_get_max_rune_number, pg_get_rune_by_id,
pg_get_rune_total_mints,
},
try_debug, try_info, try_warn,
Expand Down Expand Up @@ -320,9 +320,9 @@ impl IndexCache {
}
}

// Look for misses in database.
// Look for cache misses in database.
if cache_misses.len() > 0 {
// self.db_cache.flush(db_tx, ctx).await;
self.db_cache.flush(db_tx, ctx).await;
let output_balances = pg_get_input_rune_balances(cache_misses, db_tx, ctx).await;
indexed_input_runes.extend(output_balances);
}
Expand Down

0 comments on commit 0b1d51c

Please sign in to comment.