Opened 2 years ago

Closed 8 months ago

Last modified 5 months ago

#27480 closed New feature (fixed)

Add a Cache.touch(key, timeout=DEFAULT_TIMEOUT) method

Reported by: Victor Porton Owned by: Nicolas Noé
Component: Core (Cache system) Version: 1.10
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

I do cache.set(crypt, cache.get(crypt)) in order to prolong the life of an entry of the cache.

There should be a shorter easier way like: cache.touch(crypt).

Change History (10)

comment:1 Changed 2 years ago by Victor Porton

It also should have optional timeout argument.

comment:2 Changed 2 years ago by Tim Graham

Summary: A method to touch an entry in a cacheAdd a Cache.touch(key, timeout=DEFAULT_TIMEOUT) method
Triage Stage: UnreviewedAccepted

Seems reasonable since python-memcached and pyblicmc both implement a touch() method, I think.

comment:3 Changed 2 years ago by Nicolas Noé

Owner: changed from nobody to Nicolas Noé
Status: newassigned

comment:4 Changed 2 years ago by Nicolas Noé

Has patch: set

comment:5 Changed 2 years ago by Tim Graham

Patch needs improvement: set

Comments for improvement are on the PR.

comment:6 Changed 2 years ago by Nicolas Noé

Patch needs improvement: unset

Patch was improved, please review.

comment:7 Changed 2 years ago by Tim Graham

Triage Stage: AcceptedSomeday/Maybe

This is blocked on two fixes for python-memcached (PR #107, PR #108) so that the Django tests can use the latest version (#25277) where touch() works.

comment:8 Changed 9 months ago by Nicolas Noé

Triage Stage: Someday/MaybeAccepted

Python-memcached blocking issues solved and patch updated, please review.

comment:9 Changed 8 months ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 3246ad10:

Fixed #27480 -- Added cache.touch().

comment:10 Changed 5 months ago by Tim Graham <timograham@…>

In 2d75509b:

Refs #27480 -- Moved FileBasedCache content writing logic to a method.

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