@@ -35,57 +35,55 @@ class NodeJsonRpcHealthChecker(
3535
3636 private var previousBestFetchingBlock : Option [(Instant , BigInt )] = None
3737
38- final val peerCountHC = JsonRpcHealthcheck
38+ private val peerCountHC = JsonRpcHealthcheck
3939 .fromServiceResponse(" peerCount" , netService.peerCount(PeerCountRequest ()))
40- .map(healthcheck => healthcheck.withInfo(_.value.toString).withPredicate(" peer count is 0" )(_.value > 0 ))
40+ .map(
41+ _.withInfo(_.value.toString)
42+ .withPredicate(" peer count is 0" )(_.value > 0 )
43+ )
4144
42- final val storedBlockHC = JsonRpcHealthcheck
45+ private val storedBlockHC = JsonRpcHealthcheck
4346 .fromServiceResponse(
4447 " bestStoredBlock" ,
4548 ethBlocksService.getBlockByNumber(BlockByNumberRequest (BlockParam .Latest , fullTxs = true ))
4649 )
47- .map(healthcheck =>
48- healthcheck
49- .collect(" No block is currently stored" ) { case EthBlocksService .BlockByNumberResponse (Some (v)) => v }
50+ .map(
51+ _.collect(" No block is currently stored" ) { case EthBlocksService .BlockByNumberResponse (Some (v)) => v }
5052 .withInfo(_.number.toString)
5153 )
5254
53- final val bestKnownBlockHC = JsonRpcHealthcheck
55+ private val bestKnownBlockHC = JsonRpcHealthcheck
5456 .fromServiceResponse(" bestKnownBlock" , getBestKnownBlockTask)
55- .map(healthcheck => healthcheck .withInfo(_.toString))
57+ .map(_ .withInfo(_.toString))
5658
57- final val fetchingBlockHC = JsonRpcHealthcheck
59+ private val fetchingBlockHC = JsonRpcHealthcheck
5860 .fromServiceResponse(" bestFetchingBlock" , getBestFetchingBlockTask)
59- .map(healthcheck =>
60- healthcheck
61- .collect(" no best fetching block" ) { case Some (v) => v }
61+ .map(
62+ _.collect(" no best fetching block" ) { case Some (v) => v }
6263 .withInfo(_.toString)
6364 )
6465
65- final val updateStatusHC = JsonRpcHealthcheck
66+ private val updateStatusHC = JsonRpcHealthcheck
6667 .fromServiceResponse(" updateStatus" , getBestFetchingBlockTask)
67- .map(healthcheck =>
68- healthcheck
69- .collect(" no best fetching block" ) { case Some (v) => v }
68+ .map(
69+ _.collect(" no best fetching block" ) { case Some (v) => v }
7070 .withPredicate(s " block did not change for more than ${config.noUpdateDurationThreshold.getSeconds()} s " )(
7171 blockNumberHasChanged
7272 )
7373 )
7474
75- final val syncStatusHC =
75+ private val syncStatusHC =
7676 JsonRpcHealthcheck
7777 .fromTask(" syncStatus" , syncingController.askFor[SyncProtocol .Status ](SyncProtocol .GetStatus ))
78- .map(healthcheck =>
79- healthcheck.withInfo {
80- case NotSyncing => " STARTING"
81- case s : Syncing if isConsideredSyncing(s.blocksProgress) => " SYNCING"
82- case _ => " SYNCED"
83- }
84- )
78+ .map(_.withInfo {
79+ case NotSyncing => " STARTING"
80+ case s : Syncing if isConsideredSyncing(s.blocksProgress) => " SYNCING"
81+ case _ => " SYNCED"
82+ })
8583
8684 override def healthCheck (): Task [HealthcheckResponse ] = {
8785 val responseTask = Task
88- .sequence (
86+ .parSequence (
8987 List (
9088 peerCountHC,
9189 storedBlockHC,
0 commit comments