main: no workers catch v2
All checks were successful
Build Docker / Build Bot (push) Successful in 24s
Build Docker / Build Master (push) Successful in 25s

This commit is contained in:
Nathan Woodburn 2023-08-24 11:55:46 +10:00
parent 7162849f0c
commit 6d90a3b15c
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -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: