Skip to content

Commit 6f812e7

Browse files
committed
Centralize license_setup_ended in setup.ts
1 parent c386a7d commit 6f812e7

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

src/plugins/setup.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,6 @@ export default createPlugin(
221221
await activateLicenseUntilValid(
222222
outputChannel,
223223
cancellationToken,
224-
telemetry,
225-
origin_trigger,
226-
licenseCheckStartedAt,
227224
);
228225
}
229226

@@ -243,6 +240,19 @@ export default createPlugin(
243240
return;
244241
}
245242

243+
telemetry.track({
244+
name: "license_setup_ended",
245+
payload: {
246+
namespace: "onboarding",
247+
step_order: 3,
248+
origin: origin_trigger,
249+
auth_token: await readAuthToken(),
250+
started_at: licenseCheckStartedAt,
251+
ended_at: new Date().toISOString(),
252+
status: "COMPLETED",
253+
},
254+
});
255+
246256
/////////////////////////////////////////////////////////////////////
247257
progress.report({
248258
message: "Configuring AWS profile...",

src/utils/license.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,13 @@ export async function activateLicense(outputChannel: LogOutputChannel) {
3232
export async function activateLicenseUntilValid(
3333
outputChannel: LogOutputChannel,
3434
cancellationToken: CancellationToken,
35-
telemetry: Telemetry,
36-
origin: "manual_trigger" | "extension_startup",
37-
startedAt: string,
3835
): Promise<void> {
3936
while (true) {
4037
if (cancellationToken.isCancellationRequested) {
4138
break;
4239
}
4340
const licenseIsValid = await checkIsLicenseValid(outputChannel);
4441
if (licenseIsValid) {
45-
telemetry.track({
46-
name: "license_setup_ended",
47-
payload: {
48-
namespace: "onboarding",
49-
step_order: 3,
50-
origin: origin,
51-
auth_token: await readAuthToken(),
52-
started_at: startedAt,
53-
ended_at: new Date().toISOString(),
54-
status: "COMPLETED",
55-
},
56-
});
5742
break;
5843
}
5944
await activateLicense(outputChannel);

0 commit comments

Comments
 (0)