fix: nonlocal → global для _ping_llm_cache
This commit is contained in:
+1
-1
@@ -196,7 +196,7 @@ def register(app):
|
||||
@app.route("/api/v1/ping-llm", methods=["GET"])
|
||||
def ping_llm():
|
||||
"""Быстрая проверка доступности LLM (с кэшем 60с)."""
|
||||
nonlocal _ping_llm_cache
|
||||
global _ping_llm_cache
|
||||
now = time.time()
|
||||
if _ping_llm_cache and (now - _ping_llm_cache.get("ts", 0)) < 60:
|
||||
return jsonify(_ping_llm_cache["data"])
|
||||
|
||||
Reference in New Issue
Block a user