fix(portforward): trigger after VPN restart

This commit is contained in:
Quentin McGaw
2023-09-28 14:00:58 +00:00
parent a194906bdd
commit d4df87286e
10 changed files with 112 additions and 79 deletions

View File

@@ -11,7 +11,7 @@ func (s *Service) Start(ctx context.Context) (runError <-chan error, err error)
s.startStopMutex.Lock()
defer s.startStopMutex.Unlock()
if !*s.settings.UserSettings.Enabled {
if !*s.settings.Enabled {
return nil, nil //nolint:nilnil
}
@@ -64,6 +64,8 @@ func (s *Service) Start(ctx context.Context) (runError <-chan error, err error)
if !crashed { // stopped by Stop call
return
}
s.startStopMutex.Lock()
defer s.startStopMutex.Unlock()
_ = s.cleanup()
runError <- err
}(keepPortCtx, s.settings.PortForwarder, obj, runErrorCh, keepPortDoneCh)