feat: configure cloud API endpoints by stand

This commit is contained in:
2026-10-25 17:43:42 +03:00
parent 5b19094a4d
commit 1f8e00e4f9
7 changed files with 53 additions and 79 deletions
+4 -4
View File
@@ -1,8 +1,8 @@
import threading
from flask import Blueprint, current_app, jsonify, request
from flask import Blueprint, jsonify, request
from api.auth import get_client
from api.auth import get_client, get_endpoint, get_token
from runner import run_tests, get_status, load_config, save_config
bp = Blueprint("api", __name__)
@@ -10,11 +10,11 @@ bp = Blueprint("api", __name__)
@bp.route("/api/run", methods=["POST"])
def api_run():
token = current_app.config["NUBES_API_TOKEN"]
token = get_token()
client = get_client()
endpoint = current_app.config["NUBES_API_ENDPOINT"]
if not client:
return jsonify({"error": "Не удалось определить стенд"}), 500
endpoint = get_endpoint()
t = threading.Thread(
target=run_tests,
args=(endpoint, token),