From c59dd1fe8e5aa579ba5c2207d0d574353a95079d Mon Sep 17 00:00:00 2001 From: ScuroNeko Date: Thu, 19 Mar 2026 14:13:51 +0300 Subject: [PATCH] Handle canceled update polling without shutdown delay --- bot.go | 5 +++-- utils/version.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bot.go b/bot.go index e70f02c..cc42c25 100644 --- a/bot.go +++ b/bot.go @@ -7,7 +7,6 @@ import ( "sort" "strings" "sync" - "time" "git.nix13.pw/scuroneko/extypes" "git.nix13.pw/scuroneko/laniakea/tgapi" @@ -504,8 +503,10 @@ func (bot *Bot[T]) RunWithContext(ctx context.Context) { default: updates, err := bot.Updates(ctx) if err != nil { + if errors.Is(err, context.Canceled) { + return + } bot.logger.Errorln("failed to fetch updates:", err) - time.Sleep(time.Second) // exponential backoff continue } diff --git a/utils/version.go b/utils/version.go index 6b5a3c3..fec1438 100644 --- a/utils/version.go +++ b/utils/version.go @@ -1,9 +1,9 @@ package utils const ( - VersionString = "1.0.0-rc.2" + VersionString = "1.0.0-rc.3" VersionMajor = 1 VersionMinor = 0 VersionPatch = 0 - VersionBeta = 2 + VersionBeta = 3 )