Skip to content

Commit

Permalink
reduce log verbosity for errors due to syncing/optimistic clients
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Oct 18, 2023
1 parent 51703e8 commit a07cb2e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion indexer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,21 @@ func (client *IndexerClient) runIndexerClientLoop() {

client.retryCounter++
waitTime := 10
skipLog := false
if client.isOptimistic || client.isSynchronizing {
waitTime = 30
skipLog = true
} else if client.retryCounter > 10 {
waitTime = 300
} else if client.retryCounter > 5 {
waitTime = 60
}

logger.WithField("client", client.clientName).Warnf("indexer client error: %v, retrying in %v sec...", err, waitTime)
if skipLog {
logger.WithField("client", client.clientName).Debugf("indexer client error: %v, retrying in %v sec...", err, waitTime)
} else {
logger.WithField("client", client.clientName).Warnf("indexer client error: %v, retrying in %v sec...", err, waitTime)
}
time.Sleep(time.Duration(waitTime) * time.Second)
}
}
Expand Down

0 comments on commit a07cb2e

Please sign in to comment.