From 93eccd98a8639924f45e15f64e2226271fb51f55 Mon Sep 17 00:00:00 2001 From: sattellite Date: Wed, 3 Apr 2024 14:43:05 +0300 Subject: [PATCH] exit from waitUpdates function when context is terminated After the new changes return from the waitUpdates function was lost when the passed context was terminated. --- wait_updates.go | 1 + 1 file changed, 1 insertion(+) diff --git a/wait_updates.go b/wait_updates.go index 1ff92be..958b452 100644 --- a/wait_updates.go +++ b/wait_updates.go @@ -12,6 +12,7 @@ func (b *Bot) waitUpdates(ctx context.Context, wg *sync.WaitGroup) { for { select { case <-ctx.Done(): + return case upd := <-b.updates: b.ProcessUpdate(ctx, upd) }