Opened 5 years ago

Closed 5 years 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

Description

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 by Carlton Gibson, 5 years ago

Triage Stage: UnreviewedAccepted

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

comment:2 by Daniel Rios, 5 years ago

Owner: changed from nobody to Daniel Rios
Status: newassigned

comment:3 by Daniel Rios, 5 years ago

Has patch: set

comment:4 by Simon Charette, 5 years ago

Patch needs improvement: set

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

comment:5 by Daniel Rios, 5 years ago

Patch needs improvement: unset

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

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

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