fix update prometheus statediff block height #48

Closed
ramilexe wants to merge 1 commits from prom_statediff_block_height_fix into v1.9.24-statediff

View File

@ -273,8 +273,10 @@ func (sds *Service) writeLoopWorker(params workerParams) {
log.Error("statediff.Service.WriteLoop: processing error", "block height", currentBlock.Number().Uint64(), "error", err.Error(), "worker", params.id) log.Error("statediff.Service.WriteLoop: processing error", "block height", currentBlock.Number().Uint64(), "error", err.Error(), "worker", params.id)
continue continue
} }
// TODO: how to handle with concurrent workers lastStatediffHeight := statediffMetrics.lastStatediffHeight.Value()
if currentBlock.Number().Uint64() > uint64(lastStatediffHeight) {
statediffMetrics.lastStatediffHeight.Update(int64(currentBlock.Number().Uint64())) statediffMetrics.lastStatediffHeight.Update(int64(currentBlock.Number().Uint64()))
}
case err := <-params.errCh: case err := <-params.errCh:
log.Warn("Error from chain event subscription", "error", err, "worker", params.id) log.Warn("Error from chain event subscription", "error", err, "worker", params.id)
sds.close() sds.close()