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. */
| 2347 | * On success REDISMODULE_OK is returned. If the key is not open for |
| 2348 | * writing REDISMODULE_ERR is returned. */ |
| 2349 | int 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, |
nothing calls this directly
no test coverage detected