fix(broker): increase healthcheck start-period, catch Grammy errors
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,7 @@ COPY --from=deps --chown=bun:bun /deploy /app
|
|||||||
|
|
||||||
EXPOSE 7900
|
EXPOSE 7900
|
||||||
|
|
||||||
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 \
|
HEALTHCHECK --interval=10s --timeout=5s --start-period=30s --retries=5 \
|
||||||
CMD bun -e "fetch('http://localhost:7900/health').then(r=>{process.exit(r.ok?0:1)}).catch(()=>process.exit(1))"
|
CMD bun -e "fetch('http://localhost:7900/health').then(r=>{process.exit(r.ok?0:1)}).catch(()=>process.exit(1))"
|
||||||
|
|
||||||
# Non-root user (oven/bun image ships with 'bun' uid 1000)
|
# Non-root user (oven/bun image ships with 'bun' uid 1000)
|
||||||
|
|||||||
@@ -1404,13 +1404,15 @@ export async function bootTelegramBridge(
|
|||||||
pushHandler,
|
pushHandler,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Start Grammy long-polling
|
// Start Grammy long-polling (fire-and-forget, must not crash broker)
|
||||||
console.log("[tg-bridge] starting bot...");
|
console.log("[tg-bridge] starting bot...");
|
||||||
bot.start({
|
bot.start({
|
||||||
onStart: () =>
|
onStart: () =>
|
||||||
console.log(
|
console.log(
|
||||||
`[tg-bridge] bot running — ${meshConnections.size} mesh(es), ${chatMeshes.size} chat(s)`,
|
`[tg-bridge] bot running — ${meshConnections.size} mesh(es), ${chatMeshes.size} chat(s)`,
|
||||||
),
|
),
|
||||||
|
}).catch((err: unknown) => {
|
||||||
|
console.error("[tg-bridge] bot.start() error:", err instanceof Error ? err.message : String(err));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user