mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 17:28:53 +02: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.
|
// MarshalJSON implements json.Marshaler of HealthMonitor.
|
||||||
func (mon *monitor) MarshalJSON() ([]byte, error) {
|
func (mon *monitor) MarshalJSON() ([]byte, error) {
|
||||||
res := mon.lastResult
|
res := mon.lastResult
|
||||||
|
if res == nil {
|
||||||
|
res = &health.HealthCheckResult{
|
||||||
|
Healthy: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (&JSONRepresentation{
|
return (&JSONRepresentation{
|
||||||
Name: mon.service,
|
Name: mon.service,
|
||||||
Config: mon.config,
|
Config: mon.config,
|
||||||
|
|||||||
Reference in New Issue
Block a user