Skip to content

Commit 3d766b3

Browse files
committed
Merge pull request redis#442 from mkai/_ttl_pttl
Adjust to changed TTL, PTTL semantics
2 parents 11efdb2 + f6ddbbc commit 3d766b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

redis/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,8 +1688,8 @@ class Redis(StrictRedis):
16881688
RESPONSE_CALLBACKS = dict_merge(
16891689
StrictRedis.RESPONSE_CALLBACKS,
16901690
{
1691-
'TTL': lambda r: r != -1 and r or None,
1692-
'PTTL': lambda r: r != -1 and r or None,
1691+
'TTL': lambda r: r >= 0 and r or None,
1692+
'PTTL': lambda r: r >= 0 and r or None,
16931693
}
16941694
)
16951695

0 commit comments

Comments
 (0)