MCPcopy
hub / github.com/django/django / touch

Method touch

django/core/cache/backends/base.py:168–175  ·  view source on GitHub ↗

Update the key's expiry time using timeout. Return True if successful or False if the key does not exist.

(self, key, timeout=DEFAULT_TIMEOUT, version=None)

Source from the content-addressed store, hash-verified

166 )
167
168 def touch(self, key, timeout=DEFAULT_TIMEOUT, version=None):
169 """
170 Update the key's expiry time using timeout. Return True if successful
171 or False if the key does not exist.
172 """
173 raise NotImplementedError(
174 "subclasses of BaseCache must provide a touch() method"
175 )
176
177 async def atouch(self, key, timeout=DEFAULT_TIMEOUT, version=None):
178 return await sync_to_async(self.touch, thread_sensitive=True)(

Callers 15

test_touchMethod · 0.45
test_touchMethod · 0.45
test_forever_timeoutMethod · 0.45
test_zero_timeoutMethod · 0.45
test_no_write_accessMethod · 0.45
test_file_addedMethod · 0.45
test_exe_fallbackMethod · 0.45
setUpMethod · 0.45

Calls

no outgoing calls

Tested by 15

test_touchMethod · 0.36
test_touchMethod · 0.36
test_forever_timeoutMethod · 0.36
test_zero_timeoutMethod · 0.36
test_no_write_accessMethod · 0.36
test_file_addedMethod · 0.36
test_exe_fallbackMethod · 0.36
setUpMethod · 0.36