From 80e39a81284b3a7b18fe9bc925f5b70e37bd1a31 Mon Sep 17 00:00:00 2001 From: Josh Siegel Date: Wed, 19 Oct 2022 01:38:30 +0000 Subject: [PATCH] aptos/watcher_fix: make it just try again instead of restarting the watcher --- node/pkg/watchers/aptos/watcher.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/node/pkg/watchers/aptos/watcher.go b/node/pkg/watchers/aptos/watcher.go index ea49b295f..779c5a1ff 100644 --- a/node/pkg/watchers/aptos/watcher.go +++ b/node/pkg/watchers/aptos/watcher.go @@ -108,7 +108,7 @@ func (e *Watcher) Run(ctx context.Context) error { if err != nil { logger.Error("retrievePayload", zap.Error(err)) p2p.DefaultRegistry.AddErrorCount(vaa.ChainIDAptos, 1) - return err + continue } if !gjson.Valid(string(body)) { @@ -156,7 +156,7 @@ func (e *Watcher) Run(ctx context.Context) error { if err != nil { logger.Error("retrievePayload", zap.Error(err)) p2p.DefaultRegistry.AddErrorCount(vaa.ChainIDAptos, 1) - return err + continue } // data doesn't exist yet. skip, and try again later @@ -169,7 +169,7 @@ func (e *Watcher) Run(ctx context.Context) error { if !gjson.Valid(string(eventsJson)) { logger.Error("InvalidJson: " + string(eventsJson)) p2p.DefaultRegistry.AddErrorCount(vaa.ChainIDAptos, 1) - break + continue } @@ -198,7 +198,7 @@ func (e *Watcher) Run(ctx context.Context) error { if err != nil { logger.Error("health", zap.Error(err)) p2p.DefaultRegistry.AddErrorCount(vaa.ChainIDAptos, 1) - return err + continue } if !gjson.Valid(string(health)) {