#26619: BaseCache incr method will reset the timeout -------------------------+------------------------------------------------- Reporter: nitely | Owner: nobody Type: Bug | Status: new Component: Core | Version: 1.8 (Cache system) | Keywords: cache, incr, DatabaseCache, Severity: Normal | BaseCache Triage Stage: | Has patch: 0 Unreviewed | Easy pickings: 0 | UI/UX: 0 -------------------------+------------------------------------------------- `BaseCache.incr()` resets the timeout to the default timeout. `DatabaseCache` and `FileBasedCache` are affected by this, since they do not override the method. I'm not sure what the memcache behaviour is.
To reproduce this, set the default cache backend to `django.core.cache.backends.db.DatabaseCache` and call `incr()` on the cache. Although, [https://github.com/django/django/blob/df8d8d4292684d6ffa7474f1e201aed486f02b53/django/core/cache/backends/base.py#L186 the bug is easy to spot] since `.set(...)` is being called without passing a timeout. I'm assuming this is a bug since `LocMemCache` doesn't reset the timeout, the docs don't mention anything about it and it seems like a surprising behaviour to me. Django 1.8 and 1.9 are affected by this. -- Ticket URL: <https://code.djangoproject.com/ticket/26619> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/049.d3140839af3a3787e49d748876b5d2be%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.