main: Fixed newlines in worker file
All checks were successful
Build Docker / Build Bot (push) Successful in 23s
Build Docker / Build Master (push) Successful in 25s

This commit is contained in:
Nathan Woodburn 2023-08-25 11:42:31 +10:00
parent 287567a513
commit 6d28cf7431
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -168,7 +168,7 @@ def list_workers():
for worker in workers:
# Check worker status
if not worker.__contains__(':'):
return jsonify({'error': 'No workers available', 'success': 'false'})
continue
online=True
resp=requests.get("http://"+worker.split(':')[1].strip('\n') + ":5000/status",timeout=2)
@ -179,6 +179,8 @@ def list_workers():
sites = resp.json()['num_sites']
worker_list.append({'worker': worker.split(':')[0],'ip': worker.split(':')[1].strip('\n'), 'online': online, 'sites': sites, 'ready': 1})
if len(worker_list) == 0:
return jsonify({'error': 'No workers available', 'success': 'false'})
return jsonify({'success': 'true', 'workers': worker_list})
@app.route('/site-info', methods=['GET'])