main: Added catch for no workers
This commit is contained in:
parent
66f1b45ae6
commit
7162849f0c
@ -152,6 +152,10 @@ def list_workers():
|
|||||||
workers = workers_file.readlines()
|
workers = workers_file.readlines()
|
||||||
workers_file.close()
|
workers_file.close()
|
||||||
|
|
||||||
|
# Check if there are any workers
|
||||||
|
if len(workers) == 0:
|
||||||
|
return jsonify({'error': 'No workers available', 'success': 'false'})
|
||||||
|
|
||||||
worker_list = []
|
worker_list = []
|
||||||
for worker in workers:
|
for worker in workers:
|
||||||
# Check worker status
|
# Check worker status
|
||||||
|
Loading…
Reference in New Issue
Block a user