move out of if
@@ -180,9 +180,11 @@ def load_workers(workers_json='workers.json'):
return workers
+workers = load_workers()
+metrics = init_metrics(workers)
+
+
if __name__ == '__main__': # pragma: no cover
queue_name = os.getenv('RABBIT_QUEUE_NAME', 'task_queue')
host = os.getenv('RABBIT_HOST', 'messenger')
- workers = load_workers()
- metrics = init_metrics(workers)
main(queue_name, host)
