(new): expand runtime APIs
Golang lint / lint (push) Successful in 58s
Golang lint / lint (pull_request) Successful in 13m10s

(fix): harden concurrent lifecycle
(tests): add regression coverage
(doc): update v1.2 guidance
This commit is contained in:
2026-08-20 11:08:45 +03:00
parent 29b208eeec
commit 24040fe164
37 changed files with 1129 additions and 157 deletions
+7 -2
View File
@@ -257,10 +257,13 @@ func (bot *Bot[T]) CloseWebhook() error {
}
}
if bot.webhookLogger != nil {
if err := bot.webhookLogger.Close(); err != nil {
e = append(e, err)
if bot.webhookLoggerOwned {
if err := bot.webhookLogger.Close(); err != nil {
e = append(e, err)
}
}
bot.webhookLogger = nil
bot.webhookLoggerOwned = false
}
return errors.Join(e...)
}
@@ -283,6 +286,7 @@ func (bot *Bot[T]) runWebhookRuntime(ctx context.Context, run func(context.Conte
if bot.webhookLogger == nil {
bot.webhookLogger = utils.CreateLogger("WEBHOOK", bot.GetLoggerLevel(), bot.logFormat, bot.logFormatter)
bot.webhookLoggerOwned = true
}
bot.addTokenReplacer(bot.webhookLogger)
bot.ExecRunners(runCtx)
@@ -297,6 +301,7 @@ func (bot *Bot[T]) runWebhookRuntime(ctx context.Context, run func(context.Conte
cancel()
close(bot.updateQueue)
<-workersDone
bot.middlewareWG.Wait()
bot.runnerOnceWG.Wait()
bot.runnerBgWG.Wait()