Django

Code

Ticket #2561 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

memcached backend ignores default timeout?

Reported by: Christopher Lenz <cmlenz@gmx.de> Assigned to: jacob
Milestone: Component: Cache system
Version: 0.95 Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Okay, I might be missing something obvious here… but does the memcached backend even use the default timeout specified in the query string of the CACHE_BACKEND setting? The code doesn't suggest so. Doesn't that mean that cache entries only time out when the memory limit configured for memcached is reached?

The following patch should remedy that AFAICT:

Index: django/core/cache/backends/memcached.py
===================================================================
--- django/core/cache/backends/memcached.py     (revision 852)
+++ django/core/cache/backends/memcached.py     (working copy)
@@ -20,7 +20,7 @@
             return val
 
     def set(self, key, value, timeout=0):
-        self._cache.set(key, value, timeout)
+        self._cache.set(key, value, timeout or self.default_timeout)
 
     def delete(self, key):
         self._cache.delete(key)

BTW, there's no 0.95 version to select here.

Attachments

Change History

08/18/06 10:05:37 changed by adrian

  • version changed from SVN to 0.95.

(I've added a 0.95 version to Trac -- thanks for the pointer.)

08/18/06 10:10:08 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [3611]) Fixed #2561 -- memcached cache backend no longer ignores default timeout. Thanks for the report and patch, Christopher Lenz


Add/Change #2561 (memcached backend ignores default timeout?)




Change Properties
Action