Opened 7 years ago

Closed 6 years ago

Last modified 4 years 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 (11)

comment:1 by Victor Porton, 7 years ago

It also should have optional timeout argument.

comment:2 by Tim Graham, 7 years ago

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 by Nicolas Noé, 7 years ago

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

comment:4 by Nicolas Noé, 7 years ago

Has patch: set

comment:5 by Tim Graham, 7 years ago

Patch needs improvement: set

Comments for improvement are on the PR.

comment:6 by Nicolas Noé, 7 years ago

Patch needs improvement: unset

Patch was improved, please review.

comment:7 by Tim Graham, 7 years ago

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 by Nicolas Noé, 6 years ago

Triage Stage: Someday/MaybeAccepted

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

comment:9 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In 3246ad10:

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

comment:10 by Tim Graham <timograham@…>, 6 years ago

In 2d75509b:

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

comment:11 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In e2013b26:

Refs #29887, #27480 -- Moved touch() to BaseMemcachedCache.

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