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

Function RM_UnlinkKey

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

If the key is open for writing, unlink it (that is delete it in a * non-blocking way, not reclaiming memory immediately) and setup the key to * accept new writes as an empty key (that will be created on demand). * On success REDISMODULE_OK is returned. If the key is not open for * writing REDISMODULE_ERR is returned. */

Source from the content-addressed store, hash-verified

2347 * On success REDISMODULE_OK is returned. If the key is not open for
2348 * writing REDISMODULE_ERR is returned. */
2349int RM_UnlinkKey(RedisModuleKey *key) {
2350 if (!(key->mode & REDISMODULE_WRITE)) return REDISMODULE_ERR;
2351 if (key->value) {
2352 dbAsyncDelete(key->db,key->key);
2353 key->value = NULL;
2354 }
2355 return REDISMODULE_OK;
2356}
2357
2358/* Return the key expire value, as milliseconds of remaining TTL.
2359 * If no TTL is associated with the key or if the key is empty,

Callers

nothing calls this directly

Calls 1

dbAsyncDeleteFunction · 0.85

Tested by

no test coverage detected