shim: separate theos_block counter in healthz; wave 100/100 accounts
This commit is contained in:
@@ -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"):
|
||||
|
||||
Reference in New Issue
Block a user