(key: &str, data: String, ttl_secs: u64)
| 72 | } |
| 73 | |
| 74 | fn remote_cache_set(key: &str, data: String, ttl_secs: u64) { |
| 75 | if let Ok(mut cache) = remote_cache().lock() { |
| 76 | cache.insert(key.to_string(), CacheEntry { |
| 77 | data, |
| 78 | expires: std::time::Instant::now() + std::time::Duration::from_secs(ttl_secs), |
| 79 | }); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | pub fn remote_cache_clear() { |
| 84 | if let Some(cache) = REMOTE_CACHE.get() { |
no test coverage detected