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

Function persist_removes_ttl

nodedb/src/engine/kv/engine.rs:437–446  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

435
436 #[test]
437 fn persist_removes_ttl() {
438 let mut e = make_engine();
439 let n = now();
440
441 e.put(1, "cache", b"k", b"v", 3000, n, Surrogate::ZERO);
442 assert!(e.persist(1, "cache", b"k"));
443
444 // Should never expire now.
445 assert!(e.get(1, "cache", b"k", n + 100_000).is_some());
446 }
447
448 #[test]
449 fn expire_sets_ttl() {

Callers

nothing calls this directly

Calls 3

nowFunction · 0.85
make_engineFunction · 0.70
putMethod · 0.45

Tested by

no test coverage detected