fix: return an error when ping is not enabled.
This commit is contained in:
parent
6e43ab5897
commit
c33348e80c
1 changed files with 6 additions and 1 deletions
|
@ -49,7 +49,12 @@ func NewManagerFactory(staticConfiguration static.Configuration, routinesPool *s
|
||||||
factory.metricsHandler = metrics.PrometheusHandler()
|
factory.metricsHandler = metrics.PrometheusHandler()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This check is necessary because even when staticConfiguration.Ping == nil ,
|
||||||
|
// the affectation would make factory.pingHandle become a typed nil, which does not pass the nil test,
|
||||||
|
// and would break things elsewhere.
|
||||||
|
if staticConfiguration.Ping != nil {
|
||||||
factory.pingHandler = staticConfiguration.Ping
|
factory.pingHandler = staticConfiguration.Ping
|
||||||
|
}
|
||||||
|
|
||||||
return factory
|
return factory
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue