pub async fn put(&self, record: &DbRecord) {
        self.clean().await;

        debug!("BEGIN cache put");
        let key = record.get_full_binary_id();

        // special case for AZKS
        if let DbRecord::Azks(azks_ref) = &record {
            let mut guard = self.azks.write().await;
            *guard = Some(DbRecord::Azks(azks_ref.clone()));
        } else {
            let mut guard = self.map.write().await;
            // overwrite any existing items since a flush is requested
            let item = CachedItem {
                expiration: Instant::now() + self.item_lifetime,
                data: record.clone(),
            };
            (*guard).insert(key, item);
        }
        debug!("END cache put");
    }
/// Put an item into the cache
Put an item into the cache
Put an item into the cache
pub async fn put(&self, record: &DbRecord) {
        self.clean().await;
        debug!("BEGIN cache put");
        let key = record.get_full_binary_id();
        // special case for AZKS
        if let DbRecord::Azks(azks_ref) = &record {
            let mut guard = self.azks.write().await;
            *guard = Some(DbRecord::Azks(azks_ref.clone()));
        } else {
            let mut guard = self.map.write().await;
            // overwrite any existing items since a flush is requested
            let item = CachedItem {
                expiration: Instant::now() + self.item_lifetime,
                data: record.clone(),
            };
            (*guard).insert(key, item);
        }
        debug!("END cache put");
    }
pub async fn put ( & self , record : & DbRecord ) { self . clean ( ) . await ; debug ! ( " " ) ; let key = record . get_full_binary_id ( ) ; // special case for AZKS if let DbRecord :: Azks ( azks_ref ) = & record { let mut guard = self . azks . write ( ) . await ; * guard = Some ( DbRecord :: Azks ( azks_ref . clone ( ) ) ) ; } else { let mut guard = self . map . write ( ) . await ; // overwrite any existing items since a flush is requested let item = CachedItem { expiration : Instant :: now ( ) + self . item_lifetime , data : record . clone ( ) , } ; ( * guard ) . insert ( key , item ) ; } debug ! ( " " ) ; }
Put an item into the cache
Put an item into the cache
&self
record
&DbRecord
&self
record
&DbRecord