Skip to content

Commit

Permalink
Merge pull request #871 from anisjonischkeit/add_touch_command
Browse files Browse the repository at this point in the history
added TOUCH command to StrictRedis
  • Loading branch information
andymccurdy committed Jul 31, 2017
2 parents 0adba80 + 922a346 commit 33fa375
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions redis/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,13 @@ def substr(self, name, start, end=-1):
"""
return self.execute_command('SUBSTR', name, start, end)

def touch(self, *args):
"""
Alters the last access time of a key(s) ``*args``. A key is ignored
if it does not exist.
"""
return self.execute_command('TOUCH', *args)

def ttl(self, name):
"Returns the number of seconds until the key ``name`` will expire"
return self.execute_command('TTL', name)
Expand Down

0 comments on commit 33fa375

Please sign in to comment.