MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / persist

Method persist

nodedb/src/engine/kv/engine_write.rs:216–231  ·  view source on GitHub ↗

PERSIST: remove TTL from a key. Returns true if the key was found.

(&mut self, tenant_id: u64, collection: &str, key: &[u8])

Source from the content-addressed store, hash-verified

214
215 /// PERSIST: remove TTL from a key. Returns true if the key was found.
216 pub fn persist(&mut self, tenant_id: u64, collection: &str, key: &[u8]) -> bool {
217 let tkey = table_key(tenant_id, collection);
218 let table = match self.tables.get_mut(&tkey) {
219 Some(t) => t,
220 None => return false,
221 };
222
223 if let Some(meta) = table.get_entry_meta(key)
224 && meta.has_ttl
225 {
226 let composite = expiry_key(tenant_id, collection, key);
227 self.expiry.cancel(&composite, meta.expire_at_ms);
228 }
229
230 table.persist(key)
231 }
232}

Callers 1

execute_kv_persistMethod · 0.45

Calls 5

table_keyFunction · 0.85
expiry_keyFunction · 0.85
get_entry_metaMethod · 0.80
get_mutMethod · 0.45
cancelMethod · 0.45

Tested by

no test coverage detected