[Django] #30759: Make cache.delete() return whether or not it suceeded.

16 views
Skip to first unread message

Django

unread,
Sep 4, 2019, 1:32:21 PM9/4/19
to django-...@googlegroups.com
#30759: Make cache.delete() return whether or not it suceeded.
-----------------------------------------------+------------------------
Reporter: Simon Charette | Owner: nobody
Type: New feature | Status: new
Component: Core (Cache system) | Version: 2.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------------+------------------------
It can be quite useful when dealing with complex caching/locking systems
or simply for logging purposes.

Memcache clients already returns this value and it should be
straigtforward to implement for file, inmemory, and database backend based
on the number of returned rows.

Redis `del` operation also returns the number of keys it successfully
deleted so it should be implementable if it's eventually added as
discussed on the mailing list.

--
Ticket URL: <https://code.djangoproject.com/ticket/30759>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 5, 2019, 1:57:22 AM9/5/19
to django-...@googlegroups.com
#30759: Make cache.delete() return whether or not it suceeded.
-------------------------------------+------------------------------------

Reporter: Simon Charette | Owner: nobody
Type: New feature | Status: new
Component: Core (Cache system) | Version: 2.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Changes (by Carlton Gibson):

* stage: Unreviewed => Accepted


Comment:

Seems fair yes. (An individual backend could note that this wasn't
supported, if that were necessary.)

--
Ticket URL: <https://code.djangoproject.com/ticket/30759#comment:1>

Django

unread,
Sep 6, 2019, 10:50:36 AM9/6/19
to django-...@googlegroups.com
#30759: Make cache.delete() return whether or not it suceeded.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Daniel
| Rios
Type: New feature | Status: assigned

Component: Core (Cache system) | Version: 2.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Daniel Rios):

* owner: nobody => Daniel Rios
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/30759#comment:2>

Django

unread,
Oct 8, 2019, 7:37:49 AM10/8/19
to django-...@googlegroups.com
#30759: Make cache.delete() return whether or not it suceeded.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Daniel
| Rios
Type: New feature | Status: assigned
Component: Core (Cache system) | Version: 2.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Daniel Rios):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30759#comment:3>

Django

unread,
Oct 8, 2019, 7:53:11 AM10/8/19
to django-...@googlegroups.com
#30759: Make cache.delete() return whether or not it suceeded.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Daniel
| Rios
Type: New feature | Status: assigned
Component: Core (Cache system) | Version: 2.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* needs_better_patch: 0 => 1


Comment:

Left some comments for improvements on the PR regarding `delete_many` and
the return type of `delete`.

--
Ticket URL: <https://code.djangoproject.com/ticket/30759#comment:4>

Django

unread,
Nov 1, 2019, 2:40:14 AM11/1/19
to django-...@googlegroups.com
#30759: Make cache.delete() return whether or not it suceeded.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Daniel
| Rios
Type: New feature | Status: assigned
Component: Core (Cache system) | Version: 2.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Daniel Rios):

* needs_better_patch: 1 => 0


Comment:

Patch for python-memcache `delete` edge case has been patched, and tests
pass on my end.

--
Ticket URL: <https://code.djangoproject.com/ticket/30759#comment:5>

Django

unread,
Nov 14, 2019, 5:34:27 AM11/14/19
to django-...@googlegroups.com
#30759: Make cache.delete() return whether or not it suceeded.
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Daniel
| Rios
Type: New feature | Status: closed

Component: Core (Cache system) | Version: 2.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"efc3e32d6d7fb9bb41be73b80c8607b653c1fbd6" efc3e32]:
{{{
#!CommitTicketReference repository=""
revision="efc3e32d6d7fb9bb41be73b80c8607b653c1fbd6"
Fixed #30759 -- Made cache.delete() return whether it succeeded.

Thanks Simon Charette for the review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30759#comment:6>

Reply all
Reply to author
Forward
0 new messages