|
@@ -72,9 +72,10 @@ def jail(task_id, func, args, kwargs):
|
|
|
from django.db import connection
|
|
|
connection.close()
|
|
|
|
|
|
- # Reset cache connection
|
|
|
- from django.core.cache import cache
|
|
|
- cache.close()
|
|
|
+ # Reset cache connection only if using memcached
|
|
|
+ from django.core import cache
|
|
|
+ if cache.parse_backend_uri(cache.settings.CACHE_BACKEND)[0] == 'memcached':
|
|
|
+ cache.cache.close()
|
|
|
|
|
|
# Backend process cleanup
|
|
|
default_backend.process_cleanup()
|