fix crash when update fails to download fixes #33

This commit is contained in:
wh1te909 2023-04-29 16:56:15 -07:00
parent 588a4bcbf7
commit 4f01e214fd
3 changed files with 18 additions and 13 deletions

View file

@ -481,7 +481,11 @@ func (a *Agent) RunRPC() {
} else {
ret.Encode("ok")
msg.Respond(resp)
a.AgentUpdate(p.Data["url"], p.Data["inno"], p.Data["version"])
err := a.AgentUpdate(p.Data["url"], p.Data["inno"], p.Data["version"])
if err != nil {
atomic.StoreUint32(&agentUpdateLocker, 0)
return
}
atomic.StoreUint32(&agentUpdateLocker, 0)
nc.Flush()
nc.Close()