diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-02-06 17:59:20 -0800 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-02-11 09:09:25 +0100 |
| commit | e3f6e18513224c8ad081e5a19da641f49b0b43da (patch) | |
| tree | 260e3b93c96cea3ea6b5ea4cd10076c82890b77b /django/core/cache/__init__.py | |
| parent | 20ba3ce4ac8e8438070568ffba76f7d8d4986a53 (diff) | |
Fixed #31253 -- Fixed data loss possibility when using caching from async code.
Case missed in a415ce70bef6d91036b00dd2c8544aed7aeeaaed.
Diffstat (limited to 'django/core/cache/__init__.py')
| -rw-r--r-- | django/core/cache/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/cache/__init__.py b/django/core/cache/__init__.py index a6b956fdf2..735b83e94f 100644 --- a/django/core/cache/__init__.py +++ b/django/core/cache/__init__.py @@ -12,7 +12,7 @@ object. See docs/topics/cache.txt for information on the public API. """ -from threading import local +from asgiref.local import Local from django.conf import settings from django.core import signals @@ -61,7 +61,7 @@ class CacheHandler: Ensure only one instance of each alias exists per thread. """ def __init__(self): - self._caches = local() + self._caches = Local() def __getitem__(self, alias): try: |
