Skip to content

Commit

Permalink
take the safe road
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Sep 8, 2024
1 parent 6c93265 commit b8edb00
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/store/re_query/src/latest_at.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,11 @@ impl Caches {
let split_point = (cache.per_query_time.len() as f32 * fraction_to_purge) as usize;

if let Some(split_time) = cache.per_query_time.keys().nth(split_point).copied() {
cache.handle_pending_invalidation();
cache.pending_invalidations.clear();
// NOTE: By not clearing the pending invalidations set, we risk invalidating a
// future result that need not be invalidated.
// That is a much better outcome that the opposite though: not invalidating a
// future result that in fact should have been.
// See `handle_pending_invalidation` for more information.
cache.per_query_time = cache.per_query_time.split_off(&split_time);
}
}
Expand Down

0 comments on commit b8edb00

Please sign in to comment.