mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 05:47:28 +00: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_MAX_BODY_BYTES = 1024 * 1024;
|
||||||
const TELEGRAM_WEBHOOK_BODY_TIMEOUT_MS = 30_000;
|
const TELEGRAM_WEBHOOK_BODY_TIMEOUT_MS = 30_000;
|
||||||
|
const TELEGRAM_WEBHOOK_CALLBACK_TIMEOUT_MS = 10_000;
|
||||||
|
|
||||||
export async function startTelegramWebhook(opts: {
|
export async function startTelegramWebhook(opts: {
|
||||||
token: string;
|
token: string;
|
||||||
@@ -56,6 +57,8 @@ export async function startTelegramWebhook(opts: {
|
|||||||
});
|
});
|
||||||
const handler = webhookCallback(bot, "http", {
|
const handler = webhookCallback(bot, "http", {
|
||||||
secretToken: secret,
|
secretToken: secret,
|
||||||
|
onTimeout: "return",
|
||||||
|
timeoutMilliseconds: TELEGRAM_WEBHOOK_CALLBACK_TIMEOUT_MS,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (diagnosticsEnabled) {
|
if (diagnosticsEnabled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user