Skip to content

Commit 5386d58

Browse files
committed
fix: pr review
1 parent c224790 commit 5386d58

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

rust/main/agents/relayer/src/relay_api/extractor.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use eyre::eyre;
21
use hyperlane_core::{HyperlaneMessage, Indexer, H256, H512};
32
use std::{collections::HashMap, sync::Arc, time::Duration};
43
use tracing::{debug, error, warn};

rust/main/agents/relayer/src/relay_api/handlers.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ impl TxHashCache {
9797
}
9898
}
9999

100-
// Enforce max size
100+
// Enforce max size — run eviction again if still at capacity
101+
if self.cache.len() >= self.max_entries {
102+
let ttl = self.ttl;
103+
self.cache
104+
.retain(|_, &mut timestamp| now.duration_since(timestamp) < ttl);
105+
}
101106
if self.cache.len() >= self.max_entries {
102107
warn!(
103108
cache_size = self.cache.len(),

0 commit comments

Comments
 (0)