* Marks this host as available for querying. * @param {Boolean} [clearReconnection] * @internal * @ignore
(clearReconnection)
| 167 | * @ignore |
| 168 | */ |
| 169 | setUp(clearReconnection) { |
| 170 | if (!this.setDownAt) { |
| 171 | //The host is already marked as UP |
| 172 | return; |
| 173 | } |
| 174 | this.log('info', `Setting host ${this.address} as UP`); |
| 175 | this.setDownAt = 0; |
| 176 | this.isUpSince = Date.now(); |
| 177 | //if it was unhealthy and now it is not, lets reset the reconnection schedule. |
| 178 | this.reconnectionSchedule = this.options.policies.reconnection.newSchedule(); |
| 179 | if (clearReconnection) { |
| 180 | this.pool.clearNewConnectionAttempt(); |
| 181 | } |
| 182 | this.emit('up'); |
| 183 | } |
| 184 | |
| 185 | /** |
| 186 | * Resets the reconnectionSchedule and tries to issue a reconnection immediately. |
no test coverage detected