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