From 464beb1769ebd9440dee7b3efbca3b1ddb0288ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Men=C3=A9ndez?= Date: Wed, 21 Feb 2024 10:48:57 +0100 Subject: [PATCH] missing error checks --- scanner/providers/farcaster/provider.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scanner/providers/farcaster/provider.go b/scanner/providers/farcaster/provider.go index 763d8f09..240c4d3a 100644 --- a/scanner/providers/farcaster/provider.go +++ b/scanner/providers/farcaster/provider.go @@ -158,7 +158,10 @@ func (p *FarcasterProvider) HoldersBalances(ctx context.Context, _ []byte, fromB // that way we can be sure that the KeyRegistry is synced with the IDRegistry addedKeys, removedKeys, lastBlock2, synced, errLogsKeyRegistry := p.ScanLogsKeyRegistry(ctx, fromBlock, lastBlock) if errLogsKeyRegistry != nil { - return nil, 0, fromBlock, false, nil, errLogsKeyRegistry + if !errors.Is(errLogsKeyRegistry, web3.ErrTooManyRequests) { + return nil, 0, fromBlock, false, nil, errLogsKeyRegistry + } + log.Debug("too many requests error, handling scanned logs") } // at this point we have the new registered users, the added app keys and the removed ones @@ -283,7 +286,10 @@ func (p *FarcasterProvider) ScanLogsKeyRegistry(ctx context.Context, fromBlock, web3.LOG_TOPIC_FARCASTER_REMOVEKEY, ) if err != nil { - return nil, nil, 0, false, err + if !errors.Is(err, web3.ErrTooManyRequests) { + return nil, nil, 0, false, err + } + log.Debug("too many requests error, handling scanned logs") } addedKeys := make(map[uint64][][]byte, 0) removedKeys := make(map[uint64][][]byte, 0)