Skip to content

Commit

Permalink
fixing farcaster bug with error
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmenendez committed Apr 17, 2024
1 parent e037e63 commit 4007680
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/census3/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func main() {
}
for _, uri := range config.listOfWeb3Providers {
if err := w3p.AddEndpoint(uri); err != nil {
log.Warnw("error adding web3 provider (%s): %w", uri, err)
log.Warnf("error adding web3 provider (%s): %w", uri, err)

Check failure on line 150 in cmd/census3/main.go

View workflow job for this annotation

GitHub Actions / test

go.vocdoni.io/dvote/log.Warnf does not support error-wrapping directive %w
}
}
// init the database
Expand Down
9 changes: 7 additions & 2 deletions scanner/providers/farcaster/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ func (p *FarcasterProvider) keyRegistryCreationBlock() uint64 {
// before the next iteration. It also updates the last block scanned and the
// sync vars of the provider.
func (p *FarcasterProvider) initInternalScanner() {
defer func() {
if err := p.Close(); err != nil {
log.Warnf("error closing provider: %s", err.Error())
}
}()
for {
select {
case <-p.scannerCtx.Done():
Expand All @@ -363,8 +368,8 @@ func (p *FarcasterProvider) initInternalScanner() {
defer downloading.Store(false)
lastBlock, idrSynced, krSynced, err := p.scanIteration(p.scannerCtx)
if err != nil {
log.Errorf("error scanning iteration: %s", err.Error())
continue
log.Warnf("error scanning iteration: %s", err.Error())
return
}
p.contracts.lastBlock.Store(lastBlock)
log.Debugw("scanning iteration finished, sleeping...",
Expand Down

0 comments on commit 4007680

Please sign in to comment.