#25840: cache.get_or_set() works incorrectly with DummyCache backend
-------------------------------------+-------------------------------------
Reporter: oleksiyivanenko | Owner: nobody
Type: Bug | Status: new
Component: Core (Cache system) | Version: 1.9
Severity: Normal | Resolution:
Keywords: get_or_set | Triage Stage: Accepted
dummycache |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by davidszotten):
one might argue that this is a bug in the `BaseCache` implementation of
`get_or_set`:
{{{
def get_or_set(...)
# [snip]
val = self.add(key, default, timeout=timeout, version=version)
if val:
# unlikely, but we might have been added, and evicted again by the
time we get here,
# should we not call `get` with the default?
return self.get(key, version=version)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25840#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/073.2fc1187b75d7ebca98c32f92aa95d086%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.