fix(qq): honor context cancellation in startup READY probe

This commit is contained in:
Sakurapainting 2026-03-27 23:58:05 +08:00
parent 7ea4f4d8e2
commit b3b2775af3

View file

@ -255,6 +255,11 @@ func (c *QQChannel) Start(ctx context.Context) error {
return fmt.Errorf("failed to establish QQ websocket session: %w", err) return fmt.Errorf("failed to establish QQ websocket session: %w", err)
} }
return fmt.Errorf("QQ websocket session exited unexpectedly during startup") return fmt.Errorf("QQ websocket session exited unexpectedly during startup")
case <-c.ctx.Done():
if c.cancel != nil {
c.cancel()
}
return fmt.Errorf("QQ websocket startup canceled: %w", c.ctx.Err())
case <-time.After(qqStartupProbe): case <-time.After(qqStartupProbe):
if c.cancel != nil { if c.cancel != nil {
c.cancel() c.cancel()