mirror of
https://github.com/yusing/godoxy.git
synced 2026-01-11 22:30:47 +01:00
fix health monitor panic
This commit is contained in:
@@ -164,6 +164,12 @@ func (mon *monitor) String() string {
|
||||
// MarshalJSON implements json.Marshaler of HealthMonitor.
|
||||
func (mon *monitor) MarshalJSON() ([]byte, error) {
|
||||
res := mon.lastResult
|
||||
if res == nil {
|
||||
res = &health.HealthCheckResult{
|
||||
Healthy: true,
|
||||
}
|
||||
}
|
||||
|
||||
return (&JSONRepresentation{
|
||||
Name: mon.service,
|
||||
Config: mon.config,
|
||||
|
||||
Reference in New Issue
Block a user