Skip to content

Commit 9a8390a

Browse files
authored
feat: add default timout to cache_memoize (#68)
In some cases, you do not want to specify the timout for all the definitions and want the method to use the django defult cache timeout instead.
1 parent 4e834dd commit 9a8390a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cache_memoize/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88

99
from django.db import models
1010
from django.core.cache import caches, DEFAULT_CACHE_ALIAS
11+
from django.core.cache.backends.base import DEFAULT_TIMEOUT
1112

1213
from django.utils.encoding import force_bytes
1314

1415
MARKER = object()
1516

1617

1718
def cache_memoize(
18-
timeout,
19+
timeout=DEFAULT_TIMEOUT,
1920
prefix=None,
2021
extra=None,
2122
args_rewrite=None,

0 commit comments

Comments
 (0)