fix: code review #2 — _cfg.DELAY + VERSION в config/loader + мёртвые импорты
This commit is contained in:
+6
-7
@@ -8,11 +8,10 @@ Blueprint "root" регистрируется в app.py БЕЗ url_prefix.
|
||||
from flask import Blueprint, render_template
|
||||
|
||||
import mock_state
|
||||
from config.loader import SERVICES, DELAY
|
||||
from utils.now import now as _now
|
||||
import config.loader as _cfg
|
||||
|
||||
# Версия — показывается на HTML-странице и в healthcheck (опционально)
|
||||
VERSION = "0.2.2"
|
||||
# Версия — из config/loader.py (единый источник правды)
|
||||
VERSION = _cfg.VERSION
|
||||
|
||||
# Blueprint без префикса — роуты /health и / будут на корне домена
|
||||
bp = Blueprint("root", __name__)
|
||||
@@ -36,12 +35,12 @@ def index():
|
||||
текущую задержку операций. Использует Jinja2-шаблон templates/index.html
|
||||
и внешний CSS из static/style.css.
|
||||
"""
|
||||
svc_count = len(SERVICES)
|
||||
svc_count = len(_cfg.SERVICES)
|
||||
inst_count = len(mock_state.state.instances)
|
||||
return render_template(
|
||||
"index.html",
|
||||
version=VERSION,
|
||||
version=_cfg.VERSION,
|
||||
svc_count=svc_count,
|
||||
inst_count=inst_count,
|
||||
delay=DELAY,
|
||||
delay=_cfg.DELAY,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user