MCPcopy Create free account
hub / github.com/F-Stack/f-stack / isWatchedKeyExpired

Function isWatchedKeyExpired

app/redis-6.2.6/src/multi.c:356–368  ·  view source on GitHub ↗

iterates over the watched_keys list and * look for an expired key . */

Source from the content-addressed store, hash-verified

354/* iterates over the watched_keys list and
355 * look for an expired key . */
356int isWatchedKeyExpired(client *c) {
357 listIter li;
358 listNode *ln;
359 watchedKey *wk;
360 if (listLength(c->watched_keys) == 0) return 0;
361 listRewind(c->watched_keys,&li);
362 while ((ln = listNext(&li))) {
363 wk = listNodeValue(ln);
364 if (keyIsExpired(wk->db, wk->key)) return 1;
365 }
366
367 return 0;
368}
369
370/* "Touch" a key, so that if this key is being WATCHed by some client the
371 * next EXEC will fail. */

Callers 1

execCommandFunction · 0.85

Calls 3

listRewindFunction · 0.85
listNextFunction · 0.85
keyIsExpiredFunction · 0.85

Tested by

no test coverage detected