We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a00fc68 commit b84efcdCopy full SHA for b84efcd
3 files changed
rust/main/agents/relayer/src/relay_api/handlers.rs
@@ -32,10 +32,14 @@ pub struct TxHashCache {
32
33
impl TxHashCache {
34
pub fn new(max_entries: usize) -> Self {
35
+ Self::new_with_ttl(max_entries, Duration::from_secs(300))
36
+ }
37
+
38
+ pub fn new_with_ttl(max_entries: usize, ttl: Duration) -> Self {
39
Self {
40
cache: HashMap::new(),
41
max_entries,
- ttl: Duration::from_secs(300), // 5 minutes
42
+ ttl,
43
}
44
45
rust/main/agents/relayer/src/relay_api/mod.rs
@@ -5,3 +5,6 @@ pub mod metrics;
5
pub use extractor::{extract_messages, ExtractedMessage};
6
pub use handlers::ServerState;
7
pub use metrics::RelayApiMetrics;
8
9
+#[cfg(test)]
10
+mod tests;
0 commit comments