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 , 5 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 5 years ago
Has patch: | set |
---|
comment:4 by , 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 , 5 years ago
Patch needs improvement: | unset |
---|
Patch for python-memcache delete
edge case has been patched, and tests pass on my end.
Seems fair yes. (An individual backend could note that this wasn't supported, if that were necessary.)