[lbry] Minor tweaks to log messages

This commit is contained in:
Roy Lee 2021-07-29 20:59:32 -07:00
parent b23710bc33
commit ade6adb7dc
2 changed files with 8 additions and 6 deletions

View file

@ -1845,7 +1845,8 @@ func rebuildMissingClaimTrieData(b *BlockChain, done <-chan struct{}) error {
return b.claimTrie.ResetHeight(target)
}
start := time.Now().Add(-6 * time.Second)
start := time.Now()
lastReport := time.Now()
// TODO: move this view inside the loop (or recreate it every 5 sec.)
// as accumulating all inputs has potential to use a huge amount of RAM
// but we need to get the spent inputs working for that to be possible
@ -1885,11 +1886,12 @@ func rebuildMissingClaimTrieData(b *BlockChain, done <-chan struct{}) error {
return err
}
}
if time.Since(start).Seconds() > 5.0 {
start = time.Now()
if time.Since(lastReport) > time.Second*5 {
lastReport = time.Now()
log.Infof("Rebuilding claim trie data to %d. At: %d", target, h)
}
}
log.Infof("Completed rebuilding claim trie data to %d", b.claimTrie.Height())
log.Infof("Completed rebuilding claim trie data to %d. Took %s ",
b.claimTrie.Height(), time.Since(start))
return nil
}

View file

@ -2752,12 +2752,12 @@ func newServer(listenAddrs, agentBlacklist, agentWhitelist []string,
return nil, err
}
if h := cfg.ClaimTrieHeight; h != 0 {
lbryLog.Infof("Reseting height to %d", h)
lbryLog.Infof("Reseting claim trie height to %d", h)
err := ct.ResetHeight(int32(h))
if err != nil {
return nil, err
}
lbryLog.Infof("Height is reset to %d", h)
lbryLog.Infof("Claim trie height is reset to %d", h)
}
}