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:
4 files changed
+98
-29
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user