diff options
| author | Nick Pope <nick@nickpope.me.uk> | 2022-05-12 14:13:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-12 15:13:51 +0200 |
| commit | 20e65a34aea0ace077033c84854dcf225e248f8c (patch) | |
| tree | 134d285e207b161684e313ee21d5b3d346478ba7 /django/core/cache/__init__.py | |
| parent | 3a82b5f655446f0ca89e3b6a92b100aa458f348f (diff) | |
Made closing in connection handlers more DRY.
Diffstat (limited to 'django/core/cache/__init__.py')
| -rw-r--r-- | django/core/cache/__init__.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/django/core/cache/__init__.py b/django/core/cache/__init__.py index 613d3632ed..eb7fa5b2e9 100644 --- a/django/core/cache/__init__.py +++ b/django/core/cache/__init__.py @@ -60,8 +60,7 @@ cache = ConnectionProxy(caches, DEFAULT_CACHE_ALIAS) def close_caches(**kwargs): # Some caches need to do a cleanup at the end of a request cycle. If not # implemented in a particular backend cache.close() is a no-op. - for cache in caches.all(initialized_only=True): - cache.close() + caches.close_all() signals.request_finished.connect(close_caches) |
