Opened 9 months ago

Closed 7 months ago

#30759 closed New feature (fixed)

Make cache.delete() return whether or not it suceeded.

Reported by: Simon Charette Owned by: Daniel Rios
Component: Core (Cache system) Version: 2.2
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


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.

Change History (6)

comment:1 Changed 9 months ago by Carlton Gibson

Triage Stage: UnreviewedAccepted

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

comment:2 Changed 9 months ago by Daniel Rios

Owner: changed from nobody to Daniel Rios
Status: newassigned

comment:3 Changed 8 months ago by Daniel Rios

Has patch: set

comment:4 Changed 8 months ago by Simon Charette

Patch needs improvement: set

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

comment:5 Changed 7 months ago by Daniel Rios

Patch needs improvement: unset

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

comment:6 Changed 7 months ago by Mariusz Felisiak <felisiak.mariusz@…>

Resolution: fixed
Status: assignedclosed

In efc3e32:

Fixed #30759 -- Made cache.delete() return whether it succeeded.

Thanks Simon Charette for the review.

Note: See TracTickets for help on using tickets.
Back to Top