• Ning Sun's avatar
    Add NX/XX/GT/LT options to EXPIRE command group (#2795) · f74af0e6
    Ning Sun authored
    
    
    Add NX, XX, GT, and LT flags to EXPIRE, PEXPIRE, EXPIREAT, PEXAPIREAT.
    - NX - only modify the TTL if no TTL is currently set 
    - XX - only modify the TTL if there is a TTL currently set 
    - GT - only increase the TTL (considering non-volatile keys as infinite expire time)
    - LT - only decrease the TTL (considering non-volatile keys as infinite expire time)
    return value of the command is 0 when the operation was skipped due to one of these flags.
    Signed-off-by: default avatarNing Sun <sunng@protonmail.com>
    f74af0e6
expire.c 29.4 KB