mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-17 04:30:03 +02:00
ship_processor.go: Send hearthbeat every 10'th block.
This commit is contained in:
parent
3694bc1c42
commit
770f0a48ef
1 changed files with 15 additions and 0 deletions
|
|
@ -44,6 +44,21 @@ func processBlock(block *ship.GetBlocksResultV0) {
|
|||
if block.ThisBlock.BlockNum%100 == 0 {
|
||||
log.Infof("Current: %d, Head: %d\n", block.ThisBlock.BlockNum, block.Head.BlockNum)
|
||||
}
|
||||
|
||||
if block.ThisBlock.BlockNum%10 == 0 {
|
||||
hb := HearthBeat{
|
||||
BlockNum: block.ThisBlock.BlockNum,
|
||||
LastIrreversibleBlockNum: block.LastIrreversible.BlockNum,
|
||||
HeadBlockNum: block.Head.BlockNum,
|
||||
}
|
||||
|
||||
encodeQueue("hearthbeat", hb)
|
||||
|
||||
_, err := redis.Send()
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to send redis")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func processTraces(traces []*ship.TransactionTraceV0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue