multi: add tor connection healthcheck

This commit adds a new health check, tor connection, to our liveness
monitor. A monitor refactor is applied to the server creation such that
the scope of health check creation is managed within one function.
This commit is contained in:
yyforyongyu committed 2021-10-11 13:11:55 +08:00
1 parent ca13750b2c
commit f41f5c7fa6
4 files changed
+98 -29

No files matched your search

+6
View File
@@ -28,6 +28,8 @@ type HealthCheckConfig struct {
DiskCheck *DiskCheckConfig `group:"diskspace" namespace:"diskspace"`
TLSCheck *CheckConfig `group:"tls" namespace:"tls"`
TorConnection *CheckConfig `group:"torconnection" namespace:"torconnection"`
}
// Validate checks the values configured for our health checks.
@@ -50,6 +52,10 @@ func (h *HealthCheckConfig) Validate() error {
return errors.New("disk required ratio must be in [0:1)")
}
if err := h.TorConnection.validate("tor connection"); err != nil {
return err
}
return nil
}