mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 12:42:34 +02:00
fix health monitor panic
This commit is contained in:
parent
9bed5bf872
commit
508b093278
1 changed files with 6 additions and 0 deletions
|
@ -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,
|
||||||
|
|
Loading…
Add table
Reference in a new issue