Skip to content

Commit 9bee7b9

Browse files
committed
Add check for DEFAULT_TIMEOUT in DjangoCache.memoize
1 parent 19f908b commit 9bee7b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

diskcache/djangocache.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,12 @@ def wrapper(*args, **kwargs):
411411

412412
if result is ENOVAL:
413413
result = func(*args, **kwargs)
414-
if timeout is None or timeout > 0:
414+
valid_timeout = (
415+
timeout is None
416+
or timeout == DEFAULT_TIMEOUT
417+
or timeout > 0
418+
)
419+
if valid_timeout:
415420
self.set(
416421
key, result, timeout, version, tag=tag, retry=True,
417422
)

0 commit comments

Comments
 (0)