Skip to content

Commit

Permalink
fix(eventsub): correct loop for channels
Browse files Browse the repository at this point in the history
  • Loading branch information
Satont committed May 31, 2024
1 parent d00540a commit 0ca65b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion apps/eventsub/internal/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func NewManager(opts Opts) (*Manager, error) {
}

locker := redsync.New(redsyncredis.NewPool(opts.Redis))
startDistributedLock := locker.NewMutex("eventsub:startDistrubitedLock")
startDistributedLock := locker.NewMutex("eventsub:startDistributedLock")

opts.Lc.Append(
fx.Hook{
Expand Down Expand Up @@ -143,6 +143,8 @@ func NewManager(opts Opts) (*Manager, error) {
for _, channel := range channels {
channelsWg.Add(1)

channel := channel

go func() {
defer channelsWg.Done()
err = manager.SubscribeToNeededEvents(
Expand Down
4 changes: 1 addition & 3 deletions apps/eventsub/internal/manager/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ func (c *Manager) SubscribeWithLimits(
) {
data, err := retry.DoWithData(
func() (*esb.RequestStatus, error) {
data, subscribeErr := c.Subscribe(ctx, srq)

return data, subscribeErr
return c.Subscribe(ctx, srq)
},
retry.Attempts(0),
retry.Delay(1*time.Second),
Expand Down

0 comments on commit 0ca65b9

Please sign in to comment.