From 6d90a3b15ce726d2bafe849c87080b6b3408078e Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Thu, 24 Aug 2023 11:55:46 +1000 Subject: [PATCH] main: no workers catch v2 --- master/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/master/main.py b/master/main.py index 7cd91f9..e5bb867 100644 --- a/master/main.py +++ b/master/main.py @@ -152,9 +152,11 @@ def list_workers(): workers = workers_file.readlines() workers_file.close() - # Check if there are any workers + # Check if there are any workers (by seeing if there are any :) if len(workers) == 0: return jsonify({'error': 'No workers available', 'success': 'false'}) + if not worker.contains(':'): + return jsonify({'error': 'No workers available', 'success': 'false'}) worker_list = [] for worker in workers: