Skip to content

Commit c3b884f

Browse files
author
Ludo Galabru
committed
fix: clear cache more regularly
1 parent c83a272 commit c3b884f

File tree

1 file changed

+2
-2
lines changed
  • components/chainhook-sdk/src/hord/db

1 file changed

+2
-2
lines changed

components/chainhook-sdk/src/hord/db/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -794,15 +794,15 @@ pub async fn fetch_and_cache_blocks_in_hord_db(
794794
}
795795

796796
if !traversals_cache.is_empty() {
797-
if num_writes % 128 == 0 {
797+
if num_writes % 16 == 0 {
798798
ctx.try_log(|logger| {
799799
slog::info!(
800800
logger,
801801
"Flushing traversals cache (#{} entries)",
802802
traversals_cache.len()
803803
);
804804
});
805-
traversals_cache.shrink_to_fit();
805+
traversals_cache.clear();
806806
}
807807
}
808808

0 commit comments

Comments
 (0)