Skip to content

Commit 106e288

Browse files
walison17iurisilvio
authored andcommitted
Thread safe cache
1 parent c7ddf0a commit 106e288

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cacheback/base.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,12 @@ def __init__(self):
9797
self.cache_alias = self.cache_alias or getattr(
9898
settings, 'CACHEBACK_CACHE_ALIAS', DEFAULT_CACHE_ALIAS
9999
)
100-
self.cache = caches[self.cache_alias]
101100
self.task_options = self.task_options or {}
102101

102+
@property
103+
def cache(self):
104+
return caches[self.cache_alias]
105+
103106
def get_init_args(self):
104107
"""
105108
Return the args that need to be passed to __init__ when

0 commit comments

Comments
 (0)