pub async fn clear_stats(&self) {
        // Flush cache to db

        let mut cache = self.cache.write().await;

        let mut db = self.db.write().await;
        for (key, val) in cache.iter() {
            db.insert(key.clone(), val.clone());
        }

        cache.clear();

        let mut stats = self.stats.write().await;
        stats.clear();
    }
/// Flushes the cache and clearn any associated stats
Flushes the cache and clearn any associated stats
Flushes the cache and clearn any associated stats
pub async fn clear_stats(&self) {
        // Flush cache to db
        let mut cache = self.cache.write().await;
        let mut db = self.db.write().await;
        for (key, val) in cache.iter() {
            db.insert(key.clone(), val.clone());
        }
        cache.clear();
        let mut stats = self.stats.write().await;
        stats.clear();
    }
pub async fn clear_stats ( & self ) { // Flush cache to db let mut cache = self . cache . write ( ) . await ; let mut db = self . db . write ( ) . await ; for ( key , val ) in cache . iter ( ) { db . insert ( key . clone ( ) , val . clone ( ) ) ; } cache . clear ( ) ; let mut stats = self . stats . write ( ) . await ; stats . clear ( ) ; }
Flushes the cache and clearn any associated stats
Flushes the cache and clearn any associated stats
&self
&self