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

Function checkAlreadyExpired

src/expire.cpp:718–726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

716}
717
718int checkAlreadyExpired(long long when) {
719 /* EXPIRE with negative TTL, or EXPIREAT with a timestamp into the past
720 * should never be executed as a DEL when load the AOF or in the context
721 * of a slave instance.
722 *
723 * Instead we add the already expired key to the database with expire time
724 * (possibly in the past) and wait for an explicit DEL from the master. */
725 return (when <= mstime() && !g_pserver->loading && (!listLength(g_pserver->masters) || g_pserver->fActiveReplica));
726}
727
728/*-----------------------------------------------------------------------------
729 * Expires Commands

Callers 3

restoreCommandFunction · 0.85
expireGenericCommandFunction · 0.85
getexCommandFunction · 0.85

Calls 1

mstimeFunction · 0.70

Tested by

no test coverage detected