fix(webhook): bump grammY timeout 10s → 25s for LLM call headroom

Production showed: Request timed out after 10000 ms / status 500.

grammY's webhookCallback defaults to 10s — fine for simple handlers but
too tight for twentyq's Workers AI call (Gemma 4 26B cold-starts can
easily exceed 10s). Raise to 25s, leaving 5s headroom under Cloudflare
Workers' 30s wall-clock cap.
This commit is contained in:
2026-04-24 15:51:16 +07:00
parent cd91c86117
commit fbef449247
+3
View File
@@ -27,6 +27,9 @@ async function getWebhookHandler(env) {
const bot = await getBot(env);
cachedWebhookHandler = webhookCallback(bot, "cloudflare-mod", {
secretToken: env.TELEGRAM_WEBHOOK_SECRET,
// Default is 10s — too short for LLM calls (Gemma 4 cold-start can exceed).
// Workers wall-clock limit is 30s; leave 5s headroom.
timeoutMilliseconds: 25000,
});
return cachedWebhookHandler;
}