Skip to content

Commit

Permalink
fix: clear cache more regularly
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludo Galabru committed Jun 9, 2023
1 parent c83a272 commit c3b884f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/chainhook-sdk/src/hord/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,15 +794,15 @@ pub async fn fetch_and_cache_blocks_in_hord_db(
}

if !traversals_cache.is_empty() {
if num_writes % 128 == 0 {
if num_writes % 16 == 0 {
ctx.try_log(|logger| {
slog::info!(
logger,
"Flushing traversals cache (#{} entries)",
traversals_cache.len()
);
});
traversals_cache.shrink_to_fit();
traversals_cache.clear();
}
}

Expand Down

0 comments on commit c3b884f

Please sign in to comment.