فهرست منبع

Automatically add buckets for task types not registered at init. Thanks thruflo

Ask Solem 15 سال پیش
والد
کامیت
d663c1b615
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      celery/worker/buckets.py

+ 2 - 0
celery/worker/buckets.py

@@ -70,6 +70,8 @@ class TaskBucket(object):
 
     def put(self, job):
         """Put a task into the appropiate bucket."""
+        if job.task_name not in self.buckets:
+            self.add_bucket_for_type(job.task_name)
         self.buckets[job.task_name].put_nowait(job)
     put_nowait = put