MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / lookupKeyUpdateObj

Function lookupKeyUpdateObj

src/db.cpp:91–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91static void lookupKeyUpdateObj(robj *val, int flags)
92{
93 /* Update the access time for the ageing algorithm.
94 * Don't do it if we have a saving child, as this will trigger
95 * a copy on write madness. */
96 if (!hasActiveChildProcessOrBGSave() && !(flags & LOOKUP_NOTOUCH))
97 {
98 if (g_pserver->maxmemory_policy & MAXMEMORY_FLAG_LFU) {
99 updateLFU(val);
100 } else {
101 val->lru = LRU_CLOCK();
102 }
103 }
104}
105
106/* Low level key lookup API, not actually called directly from commands
107 * implementations that should instead rely on lookupKeyRead(),

Callers 3

lookupKeyFunction · 0.85
lookupKeyConstFunction · 0.85
dbOverwriteFunction · 0.85

Calls 3

updateLFUFunction · 0.85
LRU_CLOCKFunction · 0.85

Tested by

no test coverage detected