From eb0705efba56f0bf8e68d388217f5634504aaefa Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Sat, 16 Dec 2023 07:19:13 -0600 Subject: [PATCH] core/services/relay/evm/mercury/wsrpc: forward health and readiness from CacheSet --- core/services/relay/evm/mercury/wsrpc/pool.go | 9 +++++---- core/web/testdata/body/health.html | 5 ++++- core/web/testdata/body/health.json | 9 +++++++++ core/web/testdata/body/health.txt | 1 + 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/core/services/relay/evm/mercury/wsrpc/pool.go b/core/services/relay/evm/mercury/wsrpc/pool.go index 76f9bc808b9..e3e2a3a5bec 100644 --- a/core/services/relay/evm/mercury/wsrpc/pool.go +++ b/core/services/relay/evm/mercury/wsrpc/pool.go @@ -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" @@ -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 } diff --git a/core/web/testdata/body/health.html b/core/web/testdata/body/health.html index 5999891a0f6..a15fd0b40f7 100644 --- a/core/web/testdata/body/health.html +++ b/core/web/testdata/body/health.html @@ -75,7 +75,10 @@
Mercury
- WSRPCPool + WSRPCPool +
+ CacheSet +
diff --git a/core/web/testdata/body/health.json b/core/web/testdata/body/health.json index d8418560543..d4ddb55c7a8 100644 --- a/core/web/testdata/body/health.json +++ b/core/web/testdata/body/health.json @@ -117,6 +117,15 @@ "output": "" } }, + { + "type": "checks", + "id": "Mercury.WSRPCPool.CacheSet", + "attributes": { + "name": "Mercury.WSRPCPool.CacheSet", + "status": "passing", + "output": "" + } + }, { "type": "checks", "id": "Monitor", diff --git a/core/web/testdata/body/health.txt b/core/web/testdata/body/health.txt index 5b636829587..c36230fe6bf 100644 --- a/core/web/testdata/body/health.txt +++ b/core/web/testdata/body/health.txt @@ -12,6 +12,7 @@ -EVM.0.Txm.WrappedEvmEstimator -JobSpawner -Mercury.WSRPCPool +-Mercury.WSRPCPool.CacheSet -Monitor -PipelineORM -PipelineRunner