Skip to content

Commit

Permalink
Merge pull request #50 from TIM952597205/master
Browse files Browse the repository at this point in the history
添加查询redis key的剩余过期时间
  • Loading branch information
Boris-code authored Apr 7, 2021
2 parents 748c496 + a046a9d commit 980abe0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions feapder/db/redisdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,17 @@ def set_expire(self, key, seconds):

self._redis.expire(key, seconds)

def get_expire(self, key):
"""
@summary: 查询过期时间
---------
@param key:
@param seconds: 秒
---------
@result:
"""
return self._redis.ttl(key)

def clear(self, table):
try:
self._redis.delete(table)
Expand Down

0 comments on commit 980abe0

Please sign in to comment.