Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use debugf logging method in message processor #82

Merged
merged 1 commit into from
Oct 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tasks/message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ import (
"github.com/filecoin-project/sentinel-visor/wait"
)

const idleSleepInterval = 60 * time.Second // time to wait if the processor runs out of blocks to process
const batchInterval = 100 * time.Millisecond // time to wait between batches
const (
idleSleepInterval = 60 * time.Second // time to wait if the processor runs out of blocks to process
batchInterval = 100 * time.Millisecond // time to wait between batches
)

var log = logging.Logger("message")

Expand Down Expand Up @@ -74,7 +76,7 @@ func (p *MessageProcessor) processBatch(ctx context.Context) (bool, error) {
// If we have no tipsets to work on then wait before trying again
if len(batch) == 0 {
sleepInterval := wait.Jitter(idleSleepInterval, 2)
log.Debugw("no tipsets to process, waiting for %s", sleepInterval)
log.Debugf("no tipsets to process, waiting for %s", sleepInterval)
time.Sleep(sleepInterval)
return false, nil
}
Expand Down