Remove Node.js v8 support (#1402)

This commit is contained in:
Tomas Della Vedova
2021-02-19 08:27:20 +01:00
committed by delvedor
parent ae3bb7031f
commit 28370acf49
43 changed files with 246 additions and 290 deletions

View File

@ -80,7 +80,7 @@ class ConnectionPool extends BaseConnectionPool {
// list a node that no longer exist. The following check verify
// that the connection is still part of the pool before
// marking it as dead.
for (var i = 0; i < this.size; i++) {
for (let i = 0; i < this.size; i++) {
if (this.connections[i].id === id) {
this.dead.push(id)
break
@ -138,7 +138,7 @@ class ConnectionPool extends BaseConnectionPool {
path: '/',
timeout: this.pingTimeout
}, (err, response) => {
var isAlive = true
let isAlive = true
const statusCode = response !== null ? response.statusCode : 0
if (err != null ||
(statusCode === 502 || statusCode === 503 || statusCode === 504)) {
@ -170,8 +170,7 @@ class ConnectionPool extends BaseConnectionPool {
isAlive: true,
connection
})
// eslint-disable-next-line standard/no-callback-literal
callback(true, connection)
callback(true, connection) // eslint-disable-line
}
}
@ -199,7 +198,7 @@ class ConnectionPool extends BaseConnectionPool {
// TODO: can we cache this?
const connections = []
for (var i = 0; i < this.size; i++) {
for (let i = 0; i < this.size; i++) {
const connection = this.connections[i]
if (noAliveConnections || connection.status === Connection.statuses.ALIVE) {
if (filter(connection) === true) {