Skip to content

Commit d2987fa

Browse files
committed
Skip setup check if file watcher is not ready
1 parent 8891ebc commit d2987fa

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

src/utils/setup-status.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,30 @@ export async function createSetupStatusTracker(
4747
);
4848

4949
const checkStatusNow = async () => {
50+
const statusesInitialized = Object.values({
51+
awsProfileTracker: awsProfileTracker.status(),
52+
authTracker: localStackAuthenticationTracker.status(),
53+
licenseTracker: licenseTracker.status(),
54+
}).every((check) => check !== undefined);
55+
56+
if (!statusesInitialized) {
57+
outputChannel.trace(
58+
`[setup-status] File watchers not initialized yet, skipping status check : ${JSON.stringify(
59+
{
60+
awsProfileTracker: awsProfileTracker.status() ?? "undefined",
61+
authTracker:
62+
localStackAuthenticationTracker.status() ?? "undefined",
63+
licenseTracker: licenseTracker.status() ?? "undefined",
64+
},
65+
)}`,
66+
);
67+
return;
68+
}
69+
5070
statuses = await checkSetupStatus(outputChannel);
5171

5272
const setupRequired = [
53-
Object.values(statuses),
73+
...Object.values(statuses),
5474
awsProfileTracker.status() === "ok",
5575
localStackAuthenticationTracker.status() === "ok",
5676
licenseTracker.status() === "ok",
@@ -95,6 +115,16 @@ export async function createSetupStatusTracker(
95115
return Promise.resolve();
96116
});
97117

118+
outputChannel.trace(
119+
`[setup-status.aws-profile] status before the first check : ${awsProfileTracker.status()}`,
120+
);
121+
outputChannel.trace(
122+
`[setup-status.auth] status before the first checkk : ${localStackAuthenticationTracker.status()}`,
123+
);
124+
outputChannel.trace(
125+
`[setup-status.license] status before the first check : ${licenseTracker.status()}`,
126+
);
127+
98128
await checkStatusNow();
99129

100130
return {

0 commit comments

Comments
 (0)