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 {
47
47
}
48
48
49
49
private async prepareClusterConnection ( projectId : string , clusterName : string ) : Promise < string > {
50
- await this . session . disconnect ( ) ;
51
-
52
50
const cluster = await inspectCluster ( this . session . apiClient , projectId , clusterName ) ;
53
51
54
52
if ( ! cluster . connectionString ) {
@@ -194,6 +192,11 @@ export class ConnectClusterTool extends AtlasToolBase {
194
192
} ,
195
193
] ,
196
194
} ;
195
+ case "connected-to-other-cluster" :
196
+ case "disconnected" :
197
+ default :
198
+ // fall through to create new connection
199
+ break ;
197
200
}
198
201
} catch ( err : unknown ) {
199
202
const error = err instanceof Error ? err : new Error ( String ( err ) ) ;
@@ -205,6 +208,7 @@ export class ConnectClusterTool extends AtlasToolBase {
205
208
// fall through to create new connection
206
209
}
207
210
211
+ await this . session . disconnect ( ) ;
208
212
const connectionString = await this . prepareClusterConnection ( projectId , clusterName ) ;
209
213
process . nextTick ( async ( ) => {
210
214
try {
You can’t perform that action at this time.
0 commit comments