File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,6 @@ export class ConnectClusterTool extends AtlasToolBase {
4747 }
4848
4949 private async prepareClusterConnection ( projectId : string , clusterName : string ) : Promise < string > {
50- await this . session . disconnect ( ) ;
51-
5250 const cluster = await inspectCluster ( this . session . apiClient , projectId , clusterName ) ;
5351
5452 if ( ! cluster . connectionString ) {
@@ -194,6 +192,11 @@ export class ConnectClusterTool extends AtlasToolBase {
194192 } ,
195193 ] ,
196194 } ;
195+ case "connected-to-other-cluster" :
196+ case "disconnected" :
197+ default :
198+ // fall through to create new connection
199+ break ;
197200 }
198201 } catch ( err : unknown ) {
199202 const error = err instanceof Error ? err : new Error ( String ( err ) ) ;
@@ -205,6 +208,7 @@ export class ConnectClusterTool extends AtlasToolBase {
205208 // fall through to create new connection
206209 }
207210
211+ await this . session . disconnect ( ) ;
208212 const connectionString = await this . prepareClusterConnection ( projectId , clusterName ) ;
209213 process . nextTick ( async ( ) => {
210214 try {
You can’t perform that action at this time.
0 commit comments