Fixing issue with Redis which was causing CPU peaking if couldn't connect.
This commit is contained in:
parent
164ac0de11
commit
fd45ac86ab
|
@ -18,6 +18,8 @@ function connectionError(timeout, err) {
|
||||||
if (CLOSED) {
|
if (CLOSED) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
CLIENT.end()
|
||||||
|
CLOSED = true
|
||||||
// always clear this on error
|
// always clear this on error
|
||||||
clearTimeout(timeout)
|
clearTimeout(timeout)
|
||||||
CONNECTED = false
|
CONNECTED = false
|
||||||
|
@ -41,7 +43,7 @@ function init() {
|
||||||
// start the timer - only allowed 5 seconds to connect
|
// start the timer - only allowed 5 seconds to connect
|
||||||
timeout = setTimeout(() => {
|
timeout = setTimeout(() => {
|
||||||
if (!CONNECTED) {
|
if (!CONNECTED) {
|
||||||
connectionError(timeout)
|
connectionError(timeout, "Did not successfully connect in timeout")
|
||||||
}
|
}
|
||||||
}, STARTUP_TIMEOUT_MS)
|
}, STARTUP_TIMEOUT_MS)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue