mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-10 04:30:20 +02:00
6acb7caf5b
- HEALTH_OPENVPN_DURATION_INITIAL - HEALTH_OPENVPN_DURATION_ADDITION
18 lines
540 B
Go
18 lines
540 B
Go
package healthcheck
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"github.com/qdm12/gluetun/internal/constants"
|
|
)
|
|
|
|
func (s *server) onUnhealthyOpenvpn(ctx context.Context) {
|
|
s.logger.Info("program has been unhealthy for " +
|
|
s.openvpn.currentHealthyWait.String() + ": restarting OpenVPN")
|
|
_, _ = s.openvpn.looper.ApplyStatus(ctx, constants.Stopped)
|
|
_, _ = s.openvpn.looper.ApplyStatus(ctx, constants.Running)
|
|
s.openvpn.currentHealthyWait += s.openvpn.healthyWaitConfig.Addition
|
|
s.openvpn.healthyTimer = time.NewTimer(s.openvpn.currentHealthyWait)
|
|
}
|