Skip to content

Commit 0a6d26d

Browse files
committed
resubscribe if noded issued new update for events handler
1 parent b902e4f commit 0a6d26d

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

pkg/events/events.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,10 @@ func (e *Processor) subscribe(ctx context.Context) error {
175175
return errors.Wrap(err, "failed to commit last block number")
176176
}
177177
case newSub := <-e.update:
178-
// if new update is received check if the current manager is healty, if not:
179-
// update the manager and return error to force resubscribe with the new manager
180-
cl, _, err := e.sub.Raw()
181-
if err != nil {
182-
e.sub = newSub
183-
return err
184-
}
185-
cl.Client.Close()
178+
// if new update is received then the connection is broken as noded only issues new update only if
179+
// the old manager is broken so we need to resubscribe with the new manager.
180+
e.sub = newSub
181+
return errors.New("new substrate manager received, trying to resubscribe to the new manager")
186182
}
187183
}
188184
}

0 commit comments

Comments
 (0)