From 4562caa58515abfea50ba90c99c1e369adde5b9d Mon Sep 17 00:00:00 2001 From: juanjo Date: Sun, 6 Sep 2026 20:20:41 +0200 Subject: [PATCH] 06-sep: [perf] opencode-tg: poll 1s, fin desde 2s, envio fragmentos 0.1s --- vps_opencode_bot/opencode_bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vps_opencode_bot/opencode_bot.py b/vps_opencode_bot/opencode_bot.py index 951845b..3db5baa 100644 --- a/vps_opencode_bot/opencode_bot.py +++ b/vps_opencode_bot/opencode_bot.py @@ -122,7 +122,7 @@ def enviar(chat_id, texto, parse="HTML"): _registrar(chat_id, tg("sendMessage", {"chat_id": chat_id, "text": texto[i:i + 3900], "parse_mode": parse})) - time.sleep(0.3) + time.sleep(0.1) def enviar_doc(chat_id, ruta, caption=None): @@ -424,7 +424,7 @@ def procesar_texto(chat, texto): comienzo = time.time() terminado = False while time.time() - comienzo < 900: - time.sleep(2) + time.sleep(1) code, hist = oc_get(f"/session/{sid}/message?limit=10") if code == 200 and isinstance(hist, list): for item in reversed(hist[-10:]): @@ -444,7 +444,7 @@ def procesar_texto(chat, texto): transcurrido = time.time() - comienzo if (code2 == 200 and isinstance(sts, dict) and sts.get(sid, {}).get("type") != "busy" - and transcurrido >= 5): + and transcurrido >= 2): terminado = True break