Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rust/hyperstack-server/src/health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ impl SlotTracker {
pub async fn record_slot_hash(&self, slot: u64, slot_hash: String) {
let mut hashes = self.slot_hashes.write().await;
hashes.insert(slot, slot_hash);

// Prune old entries to prevent unbounded growth (keep last 10000 slots)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Stale comment after cache size change

The inline comment still references the old limit of 10000 slots, but the pruning threshold has been changed to 1000. This makes the comment misleading and inconsistent with the code.

Suggested change
// Prune old entries to prevent unbounded growth (keep last 10000 slots)
// Prune old entries to prevent unbounded growth (keep last 1000 slots)
Prompt To Fix With AI
This is a comment left during a code review.
Path: rust/hyperstack-server/src/health.rs
Line: 43

Comment:
**Stale comment after cache size change**

The inline comment still references the old limit of `10000` slots, but the pruning threshold has been changed to `1000`. This makes the comment misleading and inconsistent with the code.

```suggestion
        // Prune old entries to prevent unbounded growth (keep last 1000 slots)
```

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code

let slots_to_remove: Vec<u64> = hashes
.keys()
.filter(|&&s| s < slot.saturating_sub(10000))
.filter(|&&s| s < slot.saturating_sub(1000))
.copied()
.collect();
for s in slots_to_remove {
Expand Down
Loading