mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-09-19 20:24:02 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user