core: don't print useless persist messages with nil errors
Errors should be printed only when there are errors.
This commit is contained in:
parent
b15d9d1c36
commit
102c926ef3
1 changed files with 3 additions and 1 deletions
|
@ -169,7 +169,9 @@ func (bc *Blockchain) Run(ctx context.Context) {
|
||||||
case <-persistTimer.C:
|
case <-persistTimer.C:
|
||||||
go func() {
|
go func() {
|
||||||
err := bc.Persist(ctx)
|
err := bc.Persist(ctx)
|
||||||
log.Warnf("failed to persist blockchain: %s", err)
|
if err != nil {
|
||||||
|
log.Warnf("failed to persist blockchain: %s", err)
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
persistTimer.Reset(persistInterval)
|
persistTimer.Reset(persistInterval)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue