mirror of https://github.com/openclaw/openclaw.git
fix (telegram): return webhook timeout responses to prevent retry storms
This commit is contained in:
parent
c1feda14fd
commit
f032ade9c8
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue