File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -703,22 +703,26 @@ func (e *Engine) PopulateNetbirdConfig(netbirdConfig *mgmProto.NetbirdConfig, mg
703
703
return nil
704
704
}
705
705
706
- func (e * Engine ) handleSync (update * mgmProto.SyncResponse ) error {
707
- e .syncMsgMux .Lock ()
708
- defer e .syncMsgMux .Unlock ()
709
-
710
- if update .GetAutoUpdateVersion () != skipAutoUpdateVersion {
711
- if e .updateManager == nil && update .GetAutoUpdateVersion () != disableAutoUpdate {
706
+ func (e * Engine ) handleAutoUpdateVersion (autoUpdateVersion string ) {
707
+ if autoUpdateVersion != skipAutoUpdateVersion {
708
+ if e .updateManager == nil && autoUpdateVersion != disableAutoUpdate {
712
709
e .updateManager = updatemanager .NewUpdateManager (e .statusRecorder )
713
710
e .updateManager .Start (e .ctx )
714
- } else if e .updateManager != nil && update . GetAutoUpdateVersion () == disableAutoUpdate {
711
+ } else if e .updateManager != nil && autoUpdateVersion == disableAutoUpdate {
715
712
e .updateManager .Stop ()
716
713
e .updateManager = nil
717
714
}
718
715
if e .updateManager != nil {
719
- e .updateManager .SetVersion (update . GetAutoUpdateVersion () )
716
+ e .updateManager .SetVersion (autoUpdateVersion )
720
717
}
721
718
}
719
+ }
720
+
721
+ func (e * Engine ) handleSync (update * mgmProto.SyncResponse ) error {
722
+ e .syncMsgMux .Lock ()
723
+ defer e .syncMsgMux .Unlock ()
724
+
725
+ e .handleAutoUpdateVersion (update .AutoUpdateVersion )
722
726
if update .GetNetbirdConfig () != nil {
723
727
wCfg := update .GetNetbirdConfig ()
724
728
err := e .updateTURNs (wCfg .GetTurns ())
You can’t perform that action at this time.
0 commit comments