Add active client object to status endpoint
All checks were successful
release-image / release-image (push) Successful in 2m7s
All checks were successful
release-image / release-image (push) Successful in 2m7s
This commit is contained in:
@@ -179,7 +179,10 @@ async def status(client_id):
|
|||||||
try:
|
try:
|
||||||
# Send the command and wait for a response
|
# Send the command and wait for a response
|
||||||
status_data = await send_command_to_client(client_id, NodeCommands.STATUS, wait_for_response=True, timeout=5)
|
status_data = await send_command_to_client(client_id, NodeCommands.STATUS, wait_for_response=True, timeout=5)
|
||||||
return jsonify(status_data), 200
|
return jsonify({
|
||||||
|
"active_client": current_app.active_clients[client_id].to_dict(),
|
||||||
|
"status": status_data['status']
|
||||||
|
}), 200
|
||||||
|
|
||||||
except TimeoutError:
|
except TimeoutError:
|
||||||
return jsonify({"error": f"Client {client_id} did not respond within the timeout period."}), 504
|
return jsonify({"error": f"Client {client_id} did not respond within the timeout period."}), 504
|
||||||
|
|||||||
Reference in New Issue
Block a user