Fixed memory cache cleanup

This commit is contained in:
Adolfo Gómez García 2021-07-12 12:57:48 +02:00
parent b29baf2a29
commit de5031febf

View File

@ -32,7 +32,7 @@
"""
import logging
from django.core.cache import cache as djCache
from django.core.cache import caches
from uds.core.util.cache import Cache as uCache
from uds.REST import Handler, RequestError
@ -57,5 +57,9 @@ class Cache(Handler):
raise RequestError('Invalid Request')
uCache.purge()
djCache.clear()
for i in ('default', 'memory'):
try:
caches[i].clear()
except Exception:
pass # Ignore non existing cache
return 'done'