Ticket #9595: memcached.diff

File memcached.diff, 679 bytes (added by keseldude, 16 years ago)

Patch that allows the cache timeout to actually be 0, thus allowing it to not expire.

  • memcached.py

     
    3131            else:
    3232                return val
    3333
    34     def set(self, key, value, timeout=0):
     34    def set(self, key, value, timeout=None):
    3535        if isinstance(value, unicode):
    3636            value = value.encode('utf-8')
    37         self._cache.set(smart_str(key), value, timeout or self.default_timeout)
     37        if timeout is None:
     38            timeout = self.default_timeout
     39        self._cache.set(smart_str(key), value, timeout)
    3840
    3941    def delete(self, key):
    4042        self._cache.delete(smart_str(key))
Back to Top