mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-28 11:51:53 +01:00
fix(monitor): reduce health check result initialization
This commit is contained in:
@@ -188,13 +188,15 @@ func (mon *monitor) String() string {
|
||||
return mon.Name()
|
||||
}
|
||||
|
||||
var resHealthy = &health.HealthCheckResult{
|
||||
Healthy: true,
|
||||
}
|
||||
|
||||
// MarshalJSON implements health.HealthMonitor.
|
||||
func (mon *monitor) MarshalJSON() ([]byte, error) {
|
||||
res := mon.lastResult.Load()
|
||||
if res == nil {
|
||||
res = &health.HealthCheckResult{
|
||||
Healthy: true,
|
||||
}
|
||||
res = resHealthy
|
||||
}
|
||||
|
||||
return (&health.JSONRepresentation{
|
||||
|
||||
Reference in New Issue
Block a user