File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -143,12 +143,11 @@ export class ConnectionManager extends EventEmitter<ConnectionManagerEvents> {
143143 } finally {
144144 this . changeState ( "connection-closed" , {
145145 tag : "disconnected" ,
146- connectedAtlasCluster : this . state . connectedAtlasCluster ,
147146 } ) ;
148147 }
149148 }
150149
151- return { tag : "disconnected" , connectedAtlasCluster : this . state . connectedAtlasCluster } ;
150+ return { tag : "disconnected" } ;
152151 }
153152
154153 get currentConnectionState ( ) : AnyConnectionState {
Original file line number Diff line number Diff line change @@ -135,14 +135,6 @@ export class ConnectClusterTool extends AtlasToolBase {
135135
136136 // try to connect for about 5 minutes
137137 for ( let i = 0 ; i < 600 ; i ++ ) {
138- if (
139- ! this . session . connectedAtlasCluster ||
140- this . session . connectedAtlasCluster . projectId !== atlas . projectId ||
141- this . session . connectedAtlasCluster . clusterName !== atlas . clusterName
142- ) {
143- throw new Error ( "Cluster connection aborted" ) ;
144- }
145-
146138 try {
147139 lastError = undefined ;
148140
@@ -161,6 +153,14 @@ export class ConnectClusterTool extends AtlasToolBase {
161153
162154 await sleep ( 500 ) ; // wait for 500ms before retrying
163155 }
156+
157+ if (
158+ ! this . session . connectedAtlasCluster ||
159+ this . session . connectedAtlasCluster . projectId !== atlas . projectId ||
160+ this . session . connectedAtlasCluster . clusterName !== atlas . clusterName
161+ ) {
162+ throw new Error ( "Cluster connection aborted" ) ;
163+ }
164164 }
165165
166166 if ( lastError ) {
You can’t perform that action at this time.
0 commit comments