don't ping worker for more than 2 minutes
This commit is contained in:
Родитель
8c3a78f3e3
Коммит
fbe2c0cbc8
|
@ -1417,7 +1417,13 @@ class Worker {
|
|||
debug.log(d.replace(/\n$/, ""))
|
||||
})
|
||||
|
||||
var numPing = 0
|
||||
var ping = () => {
|
||||
if (++numPing > 120) {
|
||||
error.log("cannot start worker, #pings " + numPing)
|
||||
return
|
||||
}
|
||||
|
||||
var u = this.getUrl()
|
||||
u.path = "/-tdevmgmt-/" + config.deploymentKey + "/ready"
|
||||
var creq = http.request(u, cres => {
|
||||
|
@ -1433,7 +1439,8 @@ class Worker {
|
|||
}
|
||||
})
|
||||
creq.on("error", err => {
|
||||
debug.log("ping failed, " + err.message)
|
||||
if (err.code == 'ECONNREFUSED') {}
|
||||
else debug.log("ping failed, " + err.message)
|
||||
setTimeout(ping, 1000)
|
||||
})
|
||||
creq.end()
|
||||
|
|
Загрузка…
Ссылка в новой задаче