Set a new expire for the key. If the special expire * REDISMODULE_NO_EXPIRE is set, the expire is cancelled if there was * one (the same as the PERSIST command). * * Note that the expire must be provided as a positive integer representing * the absolute Unix timestamp the key should have. * * The function returns REDISMODULE_OK on success or REDISMODULE_ERR if * the key was not open for w
| 2495 | * The function returns REDISMODULE_OK on success or REDISMODULE_ERR if |
| 2496 | * the key was not open for writing or is an empty key. */ |
| 2497 | int RM_SetAbsExpire(RedisModuleKey *key, mstime_t expire) { |
| 2498 | if (!(key->mode & REDISMODULE_WRITE) || key->value == NULL || (expire < 0 && expire != REDISMODULE_NO_EXPIRE)) |
| 2499 | return REDISMODULE_ERR; |
| 2500 | if (expire != REDISMODULE_NO_EXPIRE) { |
| 2501 | setExpire(key->ctx->client,key->db,key->key,nullptr/*subkey*/,expire); |
| 2502 | } else { |
| 2503 | removeExpire(key->db,key->key); |
| 2504 | } |
| 2505 | return REDISMODULE_OK; |
| 2506 | } |
| 2507 | |
| 2508 | /* Performs similar operation to FLUSHALL, and optionally start a new AOF file (if enabled) |
| 2509 | * If restart_aof is true, you must make sure the command that triggered this call is not |
nothing calls this directly
no test coverage detected