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

Function RM_UnlinkKey

src/module.cpp:2433–2440  ·  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

2431 * On success REDISMODULE_OK is returned. If the key is not open for
2432 * writing REDISMODULE_ERR is returned. */
2433int RM_UnlinkKey(RedisModuleKey *key) {
2434 if (!(key->mode & REDISMODULE_WRITE)) return REDISMODULE_ERR;
2435 if (key->value) {
2436 dbAsyncDelete(key->db,key->key);
2437 key->value = NULL;
2438 }
2439 return REDISMODULE_OK;
2440}
2441
2442/* Return the key expire value, as milliseconds of remaining TTL.
2443 * 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