Skip to content

Commit

Permalink
exit from waitUpdates function when context is terminated
Browse files Browse the repository at this point in the history
After the new changes return from the waitUpdates function was lost when the passed context was terminated.
  • Loading branch information
sattellite authored Apr 3, 2024
1 parent e65d48b commit 93eccd9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions wait_updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 93eccd9

Please sign in to comment.