浏览代码

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