Skip to content

Commit

Permalink
perf: Use cached mongoDB connection (#2255)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonYeMSFT authored Feb 26, 2024
1 parent 98a67f2 commit 9f9a773
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mongo/commands/connectMongoDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function loadPersistedMongoDB(): Promise<void> {

try {
const persistedNodeId: string | undefined = ext.context.globalState.get(connectedMongoKey);
if (persistedNodeId) {
if (persistedNodeId && (!ext.connectedMongoDB || ext.connectedMongoDB.fullId !== persistedNodeId)) {
const persistedNode = await ext.rgApi.appResourceTree.findTreeItem(persistedNodeId, context);
if (persistedNode) {
await ext.mongoLanguageClient.client.onReady();
Expand Down

0 comments on commit 9f9a773

Please sign in to comment.