fix(publicip): rework run loop and fix restarts

- Clearing IP data on VPN disconnection clears file
- More efficient partial updates
- Fix loop exit
- Validate settings before updating
This commit is contained in:
Quentin McGaw
2023-09-24 14:55:51 +00:00
parent e64e5af4c3
commit f96448947f
21 changed files with 308 additions and 380 deletions

View File

@@ -28,8 +28,8 @@ func (l *Loop) onTunnelUp(ctx context.Context, data tunnelUpData) {
_, _ = l.dnsLooper.ApplyStatus(ctx, constants.Running)
}
// Runs the Public IP getter job once
_, _ = l.publicip.ApplyStatus(ctx, constants.Running)
l.publicip.StartSingleRun()
if l.versionInfo {
l.versionInfo = false // only get the version information once
message, err := version.GetMessage(ctx, l.buildInfo, l.client)