Skip to content

Commit

Permalink
fix(updater): fix the bug introduced in the previous fix (#862)
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia committed Aug 10, 2024
1 parent 26f9d00 commit 397e722
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/updater/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func detectIP(ctx context.Context, ppfmt pp.PP,
ip, ok := c.Provider[ipNet].GetIP(ctx, ppfmt, ipNet, use1001)
if ok {
ppfmt.Infof(pp.EmojiInternet, "Detected the %s address: %v", ipNet.Describe(), ip)
ShouldDisplayHints[getHintIDForDetection(ipNet)] = false
} else {
ppfmt.Warningf(pp.EmojiError, "Failed to detect the %s address", ipNet.Describe())

Expand All @@ -66,15 +67,16 @@ func detectIP(ctx context.Context, ppfmt pp.PP,
case ipnet.IP4:
ppfmt.Infof(pp.EmojiHint, "If your network does not support IPv4, you can disable it with IP4_PROVIDER=none") //nolint:lll
}
ShouldDisplayHints[getHintIDForDetection(ipNet)] = false
}
if ShouldDisplayHints[HintDetectionTimeouts] && errors.Is(context.Cause(ctx), errTimeout) {
ppfmt.Infof(pp.EmojiHint,
"If your network is experiencing high latency, consider increasing DETECTION_TIMEOUT=%v",
c.DetectionTimeout,
)
ShouldDisplayHints[HintDetectionTimeouts] = false
}
}
ShouldDisplayHints[getHintIDForDetection(ipNet)] = false
return ip, generateDetectMessage(ipNet, ok)
}

Expand Down

0 comments on commit 397e722

Please sign in to comment.