فهرست منبع

Fix gevent connection leak

Using CELERYD_POOL of gevent can cause a connection leak.
Cleaning up the cached_properties prevents that.
Ross Lawley 11 سال پیش
والد
کامیت
b340eefee4
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      celery/backends/mongodb.py

+ 2 - 0
celery/backends/mongodb.py

@@ -118,6 +118,8 @@ class MongoBackend(BaseBackend):
         if self._connection is not None:
             # MongoDB connection will be closed automatically when object
             # goes out of scope
+            del(self.collection)
+            del(self.database)
             self._connection = None
 
     def _store_result(self, task_id, result, status, traceback=None):