Explorar o código

Added check to make sure to only close cache connection if its not locmem.
Also fixed clean_process

Vitaly Babiy %!s(int64=16) %!d(string=hai) anos
pai
achega
01f82ba425
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      celery/worker.py

+ 4 - 3
celery/worker.py

@@ -73,11 +73,12 @@ def jail(task_id, func, args, kwargs):
     connection.close()
 
     # Reset cache connection
-    from django.core.cache import cache
-    cache.close()
+    from django.core.cache import cache, backends
+    if not isinstance(cache,backends.locmem.CacheClass):
+        cache.close()
 
     # Backend process cleanup
-    default_backend.process_cleanup()
+    default_backend.cleanup_process()
 
     # Convert any unicode keys in the keyword arguments to ascii.
     kwargs = dict([(k.encode("utf-8"), v)