Skip to content

Commit

Permalink
respect time budget in main GC loop
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Nov 30, 2023
1 parent 2ab2da9 commit 2d00c22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/re_arrow_store/src/store_gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ impl DataStore {
..
} = self;

let now = std::time::Instant::now();
for (&row_id, (timepoint, entity_path_hash)) in &metadata_registry.registry {
if protected_rows.contains(&row_id) {
batch_is_protected = true;
Expand Down Expand Up @@ -291,7 +292,7 @@ impl DataStore {
diffs.push(dropped);
}

if num_bytes_to_drop <= 0.0 {
if now.elapsed() >= options.time_budget || num_bytes_to_drop <= 0.0 {
break;
}

Expand Down

0 comments on commit 2d00c22

Please sign in to comment.