37 | | self._cache.set(smart_str(key), value, timeout or self.default_timeout) |
| 39 | timeout = timeout or self.default_timeout |
| 40 | if timeout and timeout > 2592000: # 60*60*24*30, 30 days |
| 41 | # See http://code.google.com/p/memcached/wiki/FAQ |
| 42 | # "You can set expire times up to 30 days in the future. After that |
| 43 | # memcached interprets it as a date, and will expire the item after |
| 44 | # said date. This is a simple (but obscure) mechanic." |
| 45 | # |
| 46 | # This means that we have to switch to absolute timestamps. |
| 47 | timeout += int(time.time()) |
| 48 | self._cache.set(smart_str(key), value, timeout) |