#26619: BaseCache incr method will reset the timeout
-------------------------------------+-------------------------------------
     Reporter:  nitely               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Core (Cache system)  |                  Version:  1.8
     Severity:  Normal               |               Resolution:
     Keywords:  cache, incr,         |             Triage Stage:
  DatabaseCache, BaseCache           |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by nitely):

 Honestly, I'm not sure. Your proposal is consistent with `set()`. However,
 memcached and Redis don't set a timeout when incr/decr. I don't know of a
 in-memory cache that does that.

 The database backend could just update instead of doing a get/set, so it
 could keep the timeout (and also be atomic), not sure why it was not
 implemented that way. The filecache backend can also leave the timeout
 untouched, AFAICT.

 If I were to design the cache system from scratch I'd just `raise
 NotImplementedError` within the incr/decr of the base backend. But at this
 point, I don't know how many third-party libs that would break.

--
Ticket URL: <https://code.djangoproject.com/ticket/26619#comment:2>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.f0f2eb68e4cd1c9f553fcebc65ba140a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to