feat: implement channel healthcheck and sentinel auto-healing

This commit is contained in:
root
2026-02-14 16:20:14 +00:00
parent f56005246d
commit 1e4bf34fac
5 changed files with 73 additions and 4 deletions

View File

@@ -74,6 +74,16 @@ func (c *TelegramChannel) SetTranscriber(transcriber *voice.GroqTranscriber) {
c.transcriber = transcriber
}
func (c *TelegramChannel) HealthCheck(ctx context.Context) error {
if !c.IsRunning() {
return fmt.Errorf("telegram bot not running")
}
hCtx, cancel := withTelegramAPITimeout(ctx)
defer cancel()
_, err := c.bot.GetMe(hCtx)
return err
}
func (c *TelegramChannel) Start(ctx context.Context) error {
if c.IsRunning() {
return nil