shim: separate theos_block counter in healthz; wave 100/100 accounts

This commit is contained in:
ENI
2026-11-14 15:30:36 +02:00
parent 5bd580dad2
commit f28fa6c9c2
3 changed files with 139 additions and 1 deletions
+3 -1
View File
@@ -89,7 +89,7 @@ def call_upstream(model, payload, stream):
if "Free daily Theos" in text or "Theos are not available" in text:
with _lock:
_state["modelcool"][(email, model)] = time.time() + 6 * 3600
_state["fail"] += 1
_state["theos_block"] = _state.get("theos_block", 0) + 1
continue
# machine_required лечится пересчётом machine-id, а не сменой аккаунта
if "machine_required" in text:
@@ -126,6 +126,8 @@ class H(BaseHTTPRequestHandler):
"accounts": len(recs),
"cooling": sum(1 for r in recs if _state["cool"].get(r["email"], 0) > now),
"requests_ok": _state["ok"], "requests_fail": _state["fail"],
"theos_block": _state.get("theos_block", 0),
"modelcool": len(_state["modelcool"]),
})
return
if self.path.startswith("/v1/models"):