v1.0.85: create_client(token) everywhere — single entry point stand detection; {{ stand }} in UI

This commit is contained in:
2026-07-27 17:26:09 +04:00
parent cd2e2349e2
commit 59e87cf50f
5 changed files with 36 additions and 8 deletions
+7 -1
View File
@@ -2,6 +2,7 @@ import threading
from flask import Blueprint, current_app, jsonify, request
from api.http_client import create_client
from runner import run_tests, get_status, load_config, save_config
bp = Blueprint("api", __name__)
@@ -9,9 +10,14 @@ bp = Blueprint("api", __name__)
@bp.route("/api/run", methods=["POST"])
def api_run():
token = current_app.config["NUBES_API_TOKEN"]
result = create_client(token, current_app.config["NUBES_API_ENDPOINT"])
if not result:
return jsonify({"error": "Не удалось определить стенд"}), 500
client, endpoint = result
t = threading.Thread(
target=run_tests,
args=(current_app.config["NUBES_API_ENDPOINT"], current_app.config["NUBES_API_TOKEN"]),
args=(endpoint, token),
daemon=True,
)
t.start()