mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-20 11:51:17 +00:00
[eventsub] Fix: Stop subscription-retries when client is closed
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
12f16db1ac
commit
8b3d3bdc98
1 changed files with 6 additions and 0 deletions
|
@ -421,6 +421,12 @@ func (e *EventSubSocketClient) retryBackgroundSubscribe(st eventSubSocketSubscri
|
|||
WithMaxTotalTime(retrySubscribeMaxTotal).
|
||||
WithMinIterationTime(retrySubscribeMinWait).
|
||||
Retry(func() error {
|
||||
if err := e.runCtx.Err(); err != nil {
|
||||
// Our run-context was cancelled, stop retrying to subscribe
|
||||
// to topics as this client was closed
|
||||
return backoff.NewErrCannotRetry(err)
|
||||
}
|
||||
|
||||
return e.subscribe(st)
|
||||
})
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue