Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added expire function.

  • Loading branch information...
commit dfd4e43295381b83c760b7d778434a2125560af3 1 parent 2934b44
petro-rudenko authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 redish/client.py
View
7 redish/client.py
@@ -189,6 +189,13 @@ def get(self, key, default=None):
return self[key]
except KeyError:
return default
+
+ def expire(self, key, seconds):
+ """Set a key's time to live in seconds.
+ Returns: 1 if the timeout was set.
+ 0 if key does not exist or the timeout could not be set.
+ """
+ return self.api.expire(key, seconds)
def __getitem__(self, name):
"""``x.__getitem__(name) <==> x[name]``"""
Please sign in to comment.
Something went wrong with that request. Please try again.