Return the key expire value, as absolute Unix timestamp. * If no TTL is associated with the key or if the key is empty, * REDISMODULE_NO_EXPIRE is returned. */
| 2479 | * If no TTL is associated with the key or if the key is empty, |
| 2480 | * REDISMODULE_NO_EXPIRE is returned. */ |
| 2481 | mstime_t RM_GetAbsExpire(RedisModuleKey *key) { |
| 2482 | auto expire = key->db->getExpire(key->key); |
| 2483 | if (expire == nullptr || key->value == NULL) |
| 2484 | return REDISMODULE_NO_EXPIRE; |
| 2485 | return expire->when(); |
| 2486 | } |
| 2487 | |
| 2488 | /* Set a new expire for the key. If the special expire |
| 2489 | * REDISMODULE_NO_EXPIRE is set, the expire is cancelled if there was |