hotfix(autoheal): monitor health errors asynchronously with other setup steps

- May resolve #3021
- no need to wait for dns, port forwarding etc. to setup to monitor health errors
This commit is contained in:
Quentin McGaw
2025-12-24 02:56:22 +00:00
parent 0a0bb4cf71
commit 666f55767b
+5 -2
View File
@@ -51,6 +51,11 @@ func (l *Loop) onTunnelUp(ctx, loopCtx context.Context, data tunnelUpData) {
l.logger.Info("👉 See https://github.com/qdm12/gluetun-wiki/blob/main/faq/healthcheck.md") l.logger.Info("👉 See https://github.com/qdm12/gluetun-wiki/blob/main/faq/healthcheck.md")
} }
// Start collecting health errors asynchronously, since
// we should not wait for the code below to complete
// to start monitoring health and auto-healing.
go l.collectHealthErrors(ctx, loopCtx, healthErrCh)
if *l.dnsLooper.GetSettings().ServerEnabled { if *l.dnsLooper.GetSettings().ServerEnabled {
_, _ = l.dnsLooper.ApplyStatus(ctx, constants.Running) _, _ = l.dnsLooper.ApplyStatus(ctx, constants.Running)
} else { } else {
@@ -79,8 +84,6 @@ func (l *Loop) onTunnelUp(ctx, loopCtx context.Context, data tunnelUpData) {
if err != nil { if err != nil {
l.logger.Error(err.Error()) l.logger.Error(err.Error())
} }
l.collectHealthErrors(ctx, loopCtx, healthErrCh)
} }
func (l *Loop) collectHealthErrors(ctx, loopCtx context.Context, healthErrCh <-chan error) { func (l *Loop) collectHealthErrors(ctx, loopCtx context.Context, healthErrCh <-chan error) {