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:
@@ -1 +0,0 @@
|
||||
608698389
|
||||
+4
-1
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user