main: Added catch for no workers
All checks were successful
Build Docker / Build Bot (push) Successful in 21s
Build Docker / Build Master (push) Successful in 26s

This commit is contained in:
Nathan Woodburn 2023-08-24 11:52:13 +10:00
parent 66f1b45ae6
commit 7162849f0c
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -152,6 +152,10 @@ def list_workers():
workers = workers_file.readlines()
workers_file.close()
# Check if there are any workers
if len(workers) == 0:
return jsonify({'error': 'No workers available', 'success': 'false'})
worker_list = []
for worker in workers:
# Check worker status