MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / reset

Method reset

lib/control-connection.js:1007–1019  ·  view source on GitHub ↗

* Resets the Connection to its initial state.

()

Source from the content-addressed store, hash-verified

1005 * Resets the Connection to its initial state.
1006 */
1007 async reset() {
1008 // Reset the internal state of the ControlConnection for future initialization attempts
1009 const currentHosts = this.hosts.clear();
1010
1011 // Set the shutting down flag temporarily to avoid reconnects.
1012 this._isShuttingDown = true;
1013
1014 // Shutdown all individual pools, ignoring any shutdown error
1015 await Promise.all(currentHosts.map(h => h.shutdown()));
1016
1017 this.initialized = false;
1018 this._isShuttingDown = false;
1019 }
1020
1021 /**
1022 * Gets a Map containing the original contact points and the addresses that each one resolved to.

Callers 1

client.jsFile · 0.80

Calls 2

shutdownMethod · 0.65
clearMethod · 0.45

Tested by

no test coverage detected