all repos — telegram-bot-api @ acd4170b3b199b49f0e75d69865f88bf31aa9220

Golang bindings for the Telegram Bot API

Don't wait 3 seconds if the context was cancelled
Nicolás Pazos npazosmendez@gmail.com
Mon, 19 Aug 2024 23:32:16 -0300
commit

acd4170b3b199b49f0e75d69865f88bf31aa9220

parent

11b1a666629f22c85a2e99330efbc06a319711db

1 files changed, 5 insertions(+), 4 deletions(-)

jump to
M bot.gobot.go

@@ -473,10 +473,11 @@ }

updates, err := bot.GetUpdatesWithContext(ctx, config) if err != nil { - log.Println(err) - log.Println("Failed to get updates, retrying in 3 seconds...") - time.Sleep(time.Second * 3) - + if ctx.Err() == nil { + log.Println(err) + log.Println("Failed to get updates, retrying in 3 seconds...") + time.Sleep(time.Second * 3) + } continue }