node/pkg/ethereum: restart watcher if guardian set update fails (#1010)
This commit is contained in:
parent
d68232c447
commit
97aedff9f0
|
@ -183,6 +183,8 @@ func (e *Watcher) Run(ctx context.Context) error {
|
||||||
return fmt.Errorf("failed to request guardian set: %v", err)
|
return fmt.Errorf("failed to request guardian set: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
errC := make(chan error)
|
||||||
|
|
||||||
// Poll for guardian set.
|
// Poll for guardian set.
|
||||||
go func() {
|
go func() {
|
||||||
t := time.NewTicker(15 * time.Second)
|
t := time.NewTicker(15 * time.Second)
|
||||||
|
@ -193,8 +195,8 @@ func (e *Watcher) Run(ctx context.Context) error {
|
||||||
return
|
return
|
||||||
case <-t.C:
|
case <-t.C:
|
||||||
if err := e.fetchAndUpdateGuardianSet(logger, ctx, caller); err != nil {
|
if err := e.fetchAndUpdateGuardianSet(logger, ctx, caller); err != nil {
|
||||||
logger.Error("failed updating guardian set",
|
errC <- fmt.Errorf("failed to request guardian set: %v", err)
|
||||||
zap.Error(err), zap.String("eth_network", e.networkName))
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -287,7 +289,6 @@ func (e *Watcher) Run(ctx context.Context) error {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
errC := make(chan error)
|
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
|
|
Loading…
Reference in New Issue