Skip to content

Commit

Permalink
Merge pull request codeinthehole#101 from buserbrasil/django-cache-th…
Browse files Browse the repository at this point in the history
…read-safe

Django cache thread-safe
  • Loading branch information
stephrdev authored Jun 5, 2023
2 parents 90c425b + 106e288 commit 45d3776
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cacheback/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,12 @@ def __init__(self):
self.cache_alias = self.cache_alias or getattr(
settings, 'CACHEBACK_CACHE_ALIAS', DEFAULT_CACHE_ALIAS
)
self.cache = caches[self.cache_alias]
self.task_options = self.task_options or {}

@property
def cache(self):
return caches[self.cache_alias]

def get_init_args(self):
"""
Return the args that need to be passed to __init__ when
Expand Down

0 comments on commit 45d3776

Please sign in to comment.