Fix Cache: Invalidate negative email caches when an account is created

This commit is contained in:
Maurus Decimus
2026-06-20 09:38:59 +02:00
parent 0958d97925
commit 097e3ffe94
8 changed files with 110 additions and 15 deletions

View File

@@ -183,6 +183,11 @@ impl<K: Eq + Hash + CacheItemWeight, V: Clone + CacheItemWeight> CacheWithTtl<K,
self.0.remove(key).map(|(_, v)| v.value)
}
#[inline(always)]
pub fn retain(&self, f: impl Fn(&K) -> bool) {
self.0.retain(|key, _| f(key));
}
#[inline(always)]
pub fn clear(&self) {
self.0.clear();