feat(админка): Мой день с очередью

This commit is contained in:
anor
2026-11-06 21:23:53 +10:00
parent 0e7fd76fa1
commit 33240f6ddd
12 changed files with 274 additions and 7 deletions
+2 -2
View File
@@ -32,6 +32,7 @@ def _build(user: str) -> dict:
"latency_agent_ms": work["latency"]["agent"]["median_ms"],
"latency_agent_p95_ms": work["latency"]["agent"]["p95_ms"]},
"money": cash,
"customers": {"total": db.count_living_users(), "active_24h": work["people"]},
"attention": {"failures": work["failures"], "limit_hits": work["limit_hits"],
"unpriced": cash.get("unpriced")}}
@@ -46,8 +47,7 @@ async def ping(request: Request):
async def visit(request: Request):
user = require_admin(request)
result = await asyncio.to_thread(db.record_admin_visit, user)
_CACHE["ts"] = 0.0
_CACHE["data"] = None
# Кэш общий и personal-поля в него не входят: визит не должен его сбрасывать.
return {"ok": True, **result}