Skip to content

Commit

Permalink
core/services/relay/evm/mercury/wsrpc: forward health and readiness f…
Browse files Browse the repository at this point in the history
…rom CacheSet
  • Loading branch information
jmank88 committed Dec 16, 2023
1 parent 3cea51d commit eb0705e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
9 changes: 5 additions & 4 deletions core/services/relay/evm/mercury/wsrpc/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"sync"

"github.com/smartcontractkit/wsrpc/credentials"
"golang.org/x/exp/maps"

"github.com/smartcontractkit/chainlink/v2/core/logger"
"github.com/smartcontractkit/chainlink/v2/core/services"
Expand Down Expand Up @@ -220,11 +221,11 @@ func (p *pool) Ready() error {
if p.closed {
return errors.New("pool is closed")
}
return nil
return p.cacheSet.Ready()
}

func (p *pool) HealthReport() map[string]error {
return map[string]error{
p.Name(): p.Ready(),
}
hp := map[string]error{p.Name(): p.Ready()}
maps.Copy(hp, p.cacheSet.HealthReport())
return hp
}
5 changes: 4 additions & 1 deletion core/web/testdata/body/health.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@
<details open>
<summary title=""><span class="">Mercury</span></summary>
<details open>
<summary title="Mercury.WSRPCPool" class="noexpand"><span class="passing">WSRPCPool</span></summary>
<summary title="Mercury.WSRPCPool"><span class="passing">WSRPCPool</span></summary>
<details open>
<summary title="Mercury.WSRPCPool.CacheSet" class="noexpand"><span class="passing">CacheSet</span></summary>
</details>
</details>
</details>
<details open>
Expand Down
9 changes: 9 additions & 0 deletions core/web/testdata/body/health.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@
"output": ""
}
},
{
"type": "checks",
"id": "Mercury.WSRPCPool.CacheSet",
"attributes": {
"name": "Mercury.WSRPCPool.CacheSet",
"status": "passing",
"output": ""
}
},
{
"type": "checks",
"id": "Monitor",
Expand Down
1 change: 1 addition & 0 deletions core/web/testdata/body/health.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
-EVM.0.Txm.WrappedEvmEstimator
-JobSpawner
-Mercury.WSRPCPool
-Mercury.WSRPCPool.CacheSet
-Monitor
-PipelineORM
-PipelineRunner
Expand Down

0 comments on commit eb0705e

Please sign in to comment.