fix race condition in windows agent update amidaware/tacticalrmm#1250
This commit is contained in:
parent
eddafb873b
commit
e11c38dd49
@ -154,7 +154,7 @@ func New(logger *logrus.Logger, version string) *Agent {
|
|||||||
Option: service.KeyValue{
|
Option: service.KeyValue{
|
||||||
"StartType": "automatic",
|
"StartType": "automatic",
|
||||||
"OnFailure": "restart",
|
"OnFailure": "restart",
|
||||||
"OnFailureDelayDuration": "5s",
|
"OnFailureDelayDuration": "12s",
|
||||||
"OnFailureResetPeriod": 10,
|
"OnFailureResetPeriod": 10,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -479,6 +479,7 @@ func (a *Agent) RunRPC() {
|
|||||||
atomic.StoreUint32(&agentUpdateLocker, 0)
|
atomic.StoreUint32(&agentUpdateLocker, 0)
|
||||||
nc.Flush()
|
nc.Flush()
|
||||||
nc.Close()
|
nc.Close()
|
||||||
|
a.ControlService(winSvcName, "stop")
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
}(payload)
|
}(payload)
|
||||||
|
Loading…
Reference in New Issue
Block a user