Remove call to pingCluster with only one server
If only one server is used, the amount of requests can be reduced from a minimum of two to a minimum of one. In most cases this cuts down the response time in half.
This commit is contained in:
parent
75c5a5dca5
commit
d96a8b1773
@ -377,13 +377,15 @@ function getTable(headobj) {
|
||||
function pingCluster(hosts) {
|
||||
var promises = []
|
||||
|
||||
hosts.forEach(function(i) {
|
||||
args = {}
|
||||
args.uri = getUri(i, this.argv.secure, '')
|
||||
args.json = true
|
||||
setTlsCerts(args)
|
||||
promises.push(request(args))
|
||||
})
|
||||
if (hosts.length > 1 ) {
|
||||
hosts.forEach(function(i) {
|
||||
args = {}
|
||||
args.uri = getUri(i, this.argv.secure, '')
|
||||
args.json = true
|
||||
setTlsCerts(args)
|
||||
promises.push(request(args))
|
||||
})
|
||||
}
|
||||
|
||||
return Promise.all(promises)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user