diff --git a/internal/proxy/healthcheckmanager.go b/internal/proxy/healthcheckmanager.go index d6d841e..93825af 100644 --- a/internal/proxy/healthcheckmanager.go +++ b/internal/proxy/healthcheckmanager.go @@ -25,8 +25,6 @@ type HealthCheckManager struct { } func NewHealthCheckManager(config HealthCheckManagerConfig) *HealthCheckManager { - hcs := []*HealthChecker{} - hcm := &HealthCheckManager{ metricRPCProviderInfo: promauto.NewGaugeVec( prometheus.GaugeOpts{ @@ -75,11 +73,9 @@ func NewHealthCheckManager(config HealthCheckManagerConfig) *HealthCheckManager panic(err) } - hcs = append(hcs, hc) + hcm.hcs = append(hcm.hcs, hc) } - hcm.hcs = hcs - return hcm } diff --git a/internal/proxy/proxy.go b/internal/proxy/proxy.go index 98dc83b..91d7a0c 100644 --- a/internal/proxy/proxy.go +++ b/internal/proxy/proxy.go @@ -21,10 +21,10 @@ type Proxy struct { metricResponseStatus *prometheus.CounterVec } -func NewProxy(proxyConfig Config, healthCheckManager *HealthCheckManager) *Proxy { +func NewProxy(config Config, hcm *HealthCheckManager) *Proxy { proxy := &Proxy{ - config: proxyConfig, - healthcheckManager: healthCheckManager, + config: config, + healthcheckManager: hcm, metricResponseTime: promauto.NewHistogramVec( prometheus.HistogramOpts{ Name: "zeroex_rpc_gateway_request_duration_seconds",