Browse Source

WorkController.__repr__ failed if not fully setup. Closes #2514

Ask Solem 9 năm trước cách đây
mục cha
commit
d80ad64dce
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      celery/worker/__init__.py

+ 2 - 1
celery/worker/__init__.py

@@ -332,7 +332,8 @@ class WorkController(object):
 
     def __repr__(self):
         return '<Worker: {self.hostname} ({state})>'.format(
-            self=self, state=self.blueprint.human_state(),
+            self=self,
+            state=self.blueprint.human_state() if self.blueprint else 'INIT',
         )
 
     def __str__(self):