Browse Source

Merge branch 'vbabiy/master'

Ask Solem 16 years ago
parent
commit
43a661fc7d
1 changed files with 4 additions and 3 deletions
  1. 4 3
      celery/worker.py

+ 4 - 3
celery/worker.py

@@ -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()