Feat: Env variables to set health timeouts

- HEALTH_OPENVPN_DURATION_INITIAL
- HEALTH_OPENVPN_DURATION_ADDITION
This commit is contained in:
Quentin McGaw (desktop)
2021-07-22 20:13:20 +00:00
parent 8beff34cca
commit 6acb7caf5b
11 changed files with 307 additions and 20 deletions

View File

@@ -9,9 +9,9 @@ import (
func (s *server) onUnhealthyOpenvpn(ctx context.Context) {
s.logger.Info("program has been unhealthy for " +
s.openvpn.healthyWaitTime.String() + ": restarting OpenVPN")
s.openvpn.currentHealthyWait.String() + ": restarting OpenVPN")
_, _ = s.openvpn.looper.ApplyStatus(ctx, constants.Stopped)
_, _ = s.openvpn.looper.ApplyStatus(ctx, constants.Running)
s.openvpn.healthyWaitTime += openvpnHealthyWaitTimeAdd
s.openvpn.healthyTimer = time.NewTimer(s.openvpn.healthyWaitTime)
s.openvpn.currentHealthyWait += s.openvpn.healthyWaitConfig.Addition
s.openvpn.healthyTimer = time.NewTimer(s.openvpn.currentHealthyWait)
}