Add Operation with recover
This commit is contained in:
parent
a394e6a3e3
commit
be362f0d9f
11 changed files with 45 additions and 12 deletions
|
@ -47,7 +47,7 @@ func (l *Leadership) Participate(pool *safe.Pool) {
|
|||
notify := func(err error, time time.Duration) {
|
||||
log.Errorf("Leadership election error %+v, retrying in %s", err, time)
|
||||
}
|
||||
err := backoff.RetryNotify(operation, backOff, notify)
|
||||
err := backoff.RetryNotify(safe.OperationWithRecover(operation), backOff, notify)
|
||||
if err != nil {
|
||||
log.Errorf("Cannot elect leadership %+v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue