(new): v1.2 release
Golang lint / lint (push) Successful in 11m32s

This commit is contained in:
2026-08-19 14:58:25 +03:00
parent f03a081ed6
commit 29b208eeec
79 changed files with 7301 additions and 2060 deletions
+13 -1
View File
@@ -110,21 +110,33 @@ func (bot *Bot[T]) initLoggers(opts *BotOpts) {
func (bot *Bot[T]) beginRun() error {
bot.runStateMu.Lock()
defer bot.runStateMu.Unlock()
if bot.running || bot.ran {
bot.runStateMu.Unlock()
return ErrBotAlreadyRun
}
bot.running = true
bot.ran = true
bot.runStateMu.Unlock()
if bot.observer != nil {
bot.observerAsync = newObserverDispatcher(bot.observer, bot.logger)
}
return nil
}
func (bot *Bot[T]) finishRun() {
bot.stopObserverDispatcher()
bot.runStateMu.Lock()
bot.running = false
bot.runStateMu.Unlock()
}
func (bot *Bot[T]) stopObserverDispatcher() {
if bot.observerAsync == nil {
return
}
bot.observerAsync.close()
}
func nextPollRetryDelay(prev time.Duration) time.Duration {
if prev <= 0 {
return time.Second