mirror of https://github.com/django/django.git
Closed caches in clear_cache_handlers() signal handler.
This also fixes ResourceWarnings about unclosed sockets emitted in cache.tests.
This commit is contained in:
parent
3259983f56
commit
9cc743d0c8
|
@ -26,7 +26,8 @@ COMPLEX_OVERRIDE_SETTINGS = {'DATABASES'}
|
|||
@receiver(setting_changed)
|
||||
def clear_cache_handlers(**kwargs):
|
||||
if kwargs['setting'] == 'CACHES':
|
||||
from django.core.cache import caches
|
||||
from django.core.cache import caches, close_caches
|
||||
close_caches()
|
||||
caches._caches = Local()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue