perf: кеширование detect_endpoint в flask.g — минус 2 HTTP-запроса (v1.2.41)

Результат код-ревью #2:
  get_client() и get_stand() вызывали detect_endpoint() независимо
  → двойной HTTP-запрос к Nubes API на каждый рендер страницы.

  _cached_detect(token) кеширует результат в flask.g на время запроса.
This commit is contained in:
2026-08-04 07:26:26 +04:00
parent 06137d6082
commit cc7805a429
2 changed files with 21 additions and 9 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ from routes.api_scenario_defs import bp_defs as api_scenario_defs_bp
# Версия — показывается в топбаре UI. Меняется при КАЖДОМ изменении кода.
# Нужна для фильтрации истории (пользователь видит только записи своей версии).
VERSION = "1.2.40"
VERSION = "1.2.41"
# Flask-приложение с Jinja2-шаблонами из папки templates/
app = Flask(__name__, template_folder="templates", static_folder="static")