This commit is contained in:
Martin Cizek 2020-09-18 06:15:25 +02:00
parent d32a765ee9
commit f3804bbca6
1 changed files with 4 additions and 4 deletions

View File

@ -115,8 +115,8 @@ function Client (options) {
this._nextServer = Math.floor(Math.random() * this.urls.length)
// updated in connectSocket() after each connect
this.host = undefined
this.port = false
this.secure = false
this.port = undefined
this.secure = undefined
this.url = undefined
this.tlsOptions = options.tlsOptions
this.socketPath = options.socketPath || false
@ -827,7 +827,7 @@ Client.prototype.connect = function connect () {
var port = (server && server.port) || self.socketPath
var host = server && server.hostname
if (self.secure) {
if (server && server.secure) {
socket = tls.connect(port, host, self.tlsOptions)
socket.once('secureConnect', onConnect)
} else {
@ -996,7 +996,7 @@ Client.prototype.connect = function connect () {
initialDelay: 1,
maxDelay: 2
})
failAfter = 1
failAfter = this.urls.length || 1
}
retry.failAfter(failAfter)