MCPcopy
hub / github.com/redis/redis-py / ttl

Method ttl

redis/auth/token.py:105–112  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

103 )
104
105 def ttl(self) -> float:
106 exp = self._decoded["exp"]
107 if exp == -1:
108 return -1
109
110 return (
111 self._decoded["exp"] * 1000 - datetime.now(timezone.utc).timestamp() * 1000
112 )
113
114 def try_get(self, key: str) -> str:
115 return self._decoded.get(key)

Callers 15

test_jwt_tokenMethod · 0.95
cmds_generic.pyFile · 0.45
test_lockMethod · 0.45
_test_lock_tokenMethod · 0.45
test_timeoutMethod · 0.45
test_expireMethod · 0.45
test_getexMethod · 0.45

Calls

no outgoing calls