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

Function moduleCloseKey

app/redis-6.2.6/src/module.c:2273–2285  ·  view source on GitHub ↗

Destroy a RedisModuleKey struct (freeing is the responsibility of the caller). */

Source from the content-addressed store, hash-verified

2271
2272/* Destroy a RedisModuleKey struct (freeing is the responsibility of the caller). */
2273static void moduleCloseKey(RedisModuleKey *key) {
2274 int signal = SHOULD_SIGNAL_MODIFIED_KEYS(key->ctx);
2275 if ((key->mode & REDISMODULE_WRITE) && signal)
2276 signalModifiedKey(key->ctx->client,key->db,key->key);
2277 if (key->iter) zfree(key->iter);
2278 RM_ZsetRangeStop(key);
2279 if (key && key->value && key->value->type == OBJ_STREAM &&
2280 key->u.stream.signalready) {
2281 /* One of more RM_StreamAdd() have been done. */
2282 signalKeyAsReady(key->db, key->key, OBJ_STREAM);
2283 }
2284 decrRefCount(key->key);
2285}
2286
2287/* Close a key handle. */
2288void RM_CloseKey(RedisModuleKey *key) {

Callers 2

RM_CloseKeyFunction · 0.85
moduleScanCallbackFunction · 0.85

Calls 5

signalModifiedKeyFunction · 0.85
RM_ZsetRangeStopFunction · 0.85
signalKeyAsReadyFunction · 0.85
decrRefCountFunction · 0.85
zfreeFunction · 0.70

Tested by

no test coverage detected