Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
latenssi committed Sep 2, 2021
1 parent 7f703c5 commit 6c574df
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions chain_events/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,10 @@ func (l *Listener) Start() *Listener {

if err := l.initHeight(); err != nil {
_, ok := err.(*LockError)
if ok {
// Skip LockError as it means another listener is already handling this
} else {
if !ok {
panic(err)
}
// Skip LockError as it means another listener is already handling this
}

// TODO (latenssi): should use random intervals instead
Expand Down Expand Up @@ -134,11 +133,10 @@ func (l *Listener) Start() *Listener {

if lockErr != nil {
_, ok := lockErr.(*LockError)
if ok {
// Skip on LockError as it means another listener is already handling this round
continue
if !ok {
l.handleError(lockErr)
}
l.handleError(lockErr)
// Skip on LockError as it means another listener is already handling this round
}
}
}
Expand Down

0 comments on commit 6c574df

Please sign in to comment.