From 1a7e8eec8cbc801bbd8e0ef6cee71a4a8bf23849 Mon Sep 17 00:00:00 2001 From: Satont Date: Fri, 31 May 2024 06:58:00 +0300 Subject: [PATCH] fix(eventsub): retry deadline subscribe --- apps/eventsub/internal/manager/manager.go | 2 +- apps/eventsub/internal/manager/subscribe.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/eventsub/internal/manager/manager.go b/apps/eventsub/internal/manager/manager.go index 89be5957a..7788f49dc 100644 --- a/apps/eventsub/internal/manager/manager.go +++ b/apps/eventsub/internal/manager/manager.go @@ -136,7 +136,6 @@ func NewManager(opts Opts) (*Manager, error) { } startDistributedLock.Lock() - defer startDistributedLock.Unlock() channelsWg := sync.WaitGroup{} @@ -176,6 +175,7 @@ func NewManager(opts Opts) (*Manager, error) { ) channelsWg.Wait() + startDistributedLock.Unlock() }() return nil diff --git a/apps/eventsub/internal/manager/subscribe.go b/apps/eventsub/internal/manager/subscribe.go index 15c7dd263..59ea4a0bc 100644 --- a/apps/eventsub/internal/manager/subscribe.go +++ b/apps/eventsub/internal/manager/subscribe.go @@ -30,6 +30,10 @@ func (c *Manager) SubscribeWithLimits( return true } + if errors.Is(err, context.DeadlineExceeded) { + return true + } + return false }, ),