mirror of
https://github.com/fluencelabs/redis
synced 2025-06-13 01:01:22 +00:00
add a new SET option KEEPTTL that doesn't remove expire time
This commit is contained in:
@ -219,4 +219,17 @@ start_server {tags {"expire"}} {
|
||||
set ttl [r ttl foo]
|
||||
assert {$ttl <= 98 && $ttl > 90}
|
||||
}
|
||||
|
||||
test {SET command will remove expire} {
|
||||
r set foo bar EX 100
|
||||
r set foo bar
|
||||
r ttl foo
|
||||
} {-1}
|
||||
|
||||
test {SET - use KEEPTTL option, TTL should not be removed} {
|
||||
r set foo bar EX 100
|
||||
r set foo bar KEEPTTL
|
||||
set ttl [r ttl foo]
|
||||
assert {$ttl <= 100 && $ttl > 90}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user