Beispiel #1
0
 def retrieve(self, key):
     c = self._get_conn()
     data = c[self.collection].find_one({'key': key})
     if data:
         expires = data['expires']
         if expires is None or datetime.utcnow() < expires:
             return pickle.loads(data['value'])
     raise KeyError
Beispiel #2
0
 def retrieve(self, key):
     c = self._get_conn()
     data = c[self.collection].find_one({"key": key})
     if data:
         expires = data["expires"]
         if expires is None or datetime.utcnow() < expires:
             return pickle.loads(data["value"])
     raise KeyError
Beispiel #3
0
 def retrieve(self, key):
     data = self._get_conn().get(self._make_key(key))
     if data:
         return pickle.loads(data)
     raise KeyError
Beispiel #4
0
 def retrieve(self, key):
     data = self._get_conn().get(self._make_key(key))
     if data:
         return pickle.loads(data)
     raise KeyError