mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
fix (telegram): return webhook timeout responses to prevent retry storms
This commit is contained in:
@@ -19,6 +19,7 @@ import { createTelegramBot } from "./bot.js";
|
||||
|
||||
const TELEGRAM_WEBHOOK_MAX_BODY_BYTES = 1024 * 1024;
|
||||
const TELEGRAM_WEBHOOK_BODY_TIMEOUT_MS = 30_000;
|
||||
const TELEGRAM_WEBHOOK_CALLBACK_TIMEOUT_MS = 10_000;
|
||||
|
||||
export async function startTelegramWebhook(opts: {
|
||||
token: string;
|
||||
@@ -56,6 +57,8 @@ export async function startTelegramWebhook(opts: {
|
||||
});
|
||||
const handler = webhookCallback(bot, "http", {
|
||||
secretToken: secret,
|
||||
onTimeout: "return",
|
||||
timeoutMilliseconds: TELEGRAM_WEBHOOK_CALLBACK_TIMEOUT_MS,
|
||||
});
|
||||
|
||||
if (diagnosticsEnabled) {
|
||||
|
||||
Reference in New Issue
Block a user