Преглед на файлове

Handle possibility there are no workers (#4074)

Fixes issue where an exception is raised if eg `celery graph workers` is invoked when there are no workers at all.
Derek Harland преди 7 години
родител
ревизия
cd89518cf2
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      celery/bin/graph.py

+ 1 - 1
celery/bin/graph.py

@@ -161,7 +161,7 @@ class graph(Command):
             workers = args['nodes']
             workers = args['nodes']
             threads = args.get('threads') or []
             threads = args.get('threads') or []
         except KeyError:
         except KeyError:
-            replies = self.app.control.inspect().stats()
+            replies = self.app.control.inspect().stats() or {}
             workers, threads = [], []
             workers, threads = [], []
             for worker, reply in items(replies):
             for worker, reply in items(replies):
                 workers.append(worker)
                 workers.append(worker)