fix(broker): increase healthcheck start-period, catch Grammy errors
Some checks failed
CI / Lint (push) Has been cancelled
CI / Typecheck (push) Has been cancelled
CI / Broker tests (Postgres) (push) Has been cancelled
CI / Docker build (linux/amd64) (push) Has been cancelled

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-04-09 11:14:44 +01:00
parent ac59d2acfe
commit bb28e16c7d
2 changed files with 4 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ COPY --from=deps --chown=bun:bun /deploy /app
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))"
# Non-root user (oven/bun image ships with 'bun' uid 1000)

View File

@@ -1404,13 +1404,15 @@ export async function bootTelegramBridge(
pushHandler,
);
// Start Grammy long-polling
// Start Grammy long-polling (fire-and-forget, must not crash broker)
console.log("[tg-bridge] starting bot...");
bot.start({
onStart: () =>
console.log(
`[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));
});
}