Skip to content

Commit 832c05a

Browse files
committed
fix: add max prunes to pruner
1 parent 6d76467 commit 832c05a

File tree

1 file changed

+5
-0
lines changed
  • engine/packages/gasoline/src/db/kv

1 file changed

+5
-0
lines changed

engine/packages/gasoline/src/db/kv/debug.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ use crate::{
3838
};
3939

4040
const EARLY_TXN_TIMEOUT: Duration = Duration::from_secs(3);
41+
const MAX_PRUNES_PER_TXN: usize = 10000;
4142

4243
impl DatabaseKv {
4344
#[tracing::instrument(skip_all)]
@@ -1377,6 +1378,10 @@ impl DatabaseDebug for DatabaseKv {
13771378

13781379
prune_count += 1;
13791380
new_last_key = [entry.key(), &[0xff]].concat();
1381+
1382+
if prune_count > MAX_PRUNES_PER_TXN {
1383+
break;
1384+
}
13801385
}
13811386

13821387
Ok((prune_count, inserter, new_last_key))

0 commit comments

Comments
 (0)