Skip to content

Commit c609434

Browse files
committed
address comment: remove createdCluster from prepareClusterConenection
1 parent c2edf9f commit c609434

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/tools/atlas/connect/connectCluster.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class ConnectClusterTool extends AtlasToolBase {
6767
private async prepareClusterConnection(
6868
projectId: string,
6969
clusterName: string
70-
): Promise<{ connectionString: string; atlas: AtlasClusterConnectionInfo; userCreated: boolean }> {
70+
): Promise<{ connectionString: string; atlas: AtlasClusterConnectionInfo }> {
7171
const cluster = await inspectCluster(this.session.apiClient, projectId, clusterName);
7272

7373
if (!cluster.connectionString) {
@@ -115,7 +115,7 @@ export class ConnectClusterTool extends AtlasToolBase {
115115
cn.password = password;
116116
cn.searchParams.set("authSource", "admin");
117117

118-
return { connectionString: cn.toString(), atlas: connectedAtlasCluster, userCreated: true };
118+
return { connectionString: cn.toString(), atlas: connectedAtlasCluster };
119119
}
120120

121121
private async connectToCluster(connectionString: string, atlas: AtlasClusterConnectionInfo): Promise<void> {
@@ -233,12 +233,9 @@ export class ConnectClusterTool extends AtlasToolBase {
233233
case "disconnected":
234234
default: {
235235
await this.session.disconnect();
236-
const { connectionString, atlas, userCreated } = await this.prepareClusterConnection(
237-
projectId,
238-
clusterName
239-
);
236+
const { connectionString, atlas } = await this.prepareClusterConnection(projectId, clusterName);
240237

241-
createdUser = userCreated;
238+
createdUser = true;
242239
// try to connect for about 5 minutes asynchronously
243240
void this.connectToCluster(connectionString, atlas).catch((err: unknown) => {
244241
const error = err instanceof Error ? err : new Error(String(err));

0 commit comments

Comments
 (0)