Explorar o código

Transport can now decide which event loop to use

Ask Solem %!s(int64=9) %!d(string=hai) anos
pai
achega
70cfaecae4
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      celery/worker/components.py

+ 2 - 2
celery/worker/components.py

@@ -73,9 +73,9 @@ class Hub(bootsteps.StartStopStep):
     def create(self, w):
         w.hub = get_event_loop()
         if w.hub is None:
+            required_hub = getattr(w._conninfo, 'requires_hub', None)
             w.hub = set_event_loop((
-                w._conninfo.requires_hub
-                    if w._conninfo.requires_hub else _Hub)(w.timer))
+                required_hub if required_hub else _Hub)(w.timer))
         self._patch_thread_primitives(w)
         return self