Fix: Telegram Long-Poll Timeout-Fehler behoben

HTTP-Request-Timeout wird jetzt dynamisch aus dem Long-Poll-Timeout
berechnet (lp_timeout + 15s), statt fix 30s. Verhindert ReadTimeout
bei 25s Long-Polls. telegram_offset aus Git-Tracking entfernt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thorsten
2026-02-23 19:01:54 +01:00
parent dba79f27e6
commit 2f6a1fa357
2 changed files with 4 additions and 2 deletions
-1
View File
@@ -1 +0,0 @@
608698389
+4 -1
View File
@@ -107,8 +107,11 @@ def load_config() -> dict:
def api_get(token: str, method: str, params: dict = None) -> dict | None:
url = f"{TELEGRAM_API.format(token=token)}/{method}"
# Long-Poll timeout (Telegram-seitig) + 15s Puffer für Netzwerk-Overhead
lp_timeout = (params or {}).get("timeout", 0)
req_timeout = max(30, lp_timeout + 15)
try:
resp = requests.get(url, params=params or {}, timeout=30)
resp = requests.get(url, params=params or {}, timeout=req_timeout)
data = resp.json()
if not data.get("ok"):
logger.warning("API-Fehler bei %s: %s", method, data.get("description"))