Explorar o código

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

Ask Solem %!s(int64=15) %!d(string=hai) anos
pai
achega
d663c1b615
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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