Skip to content

Commit e17e9ed

Browse files
authored
Less time for teardown (#186)
1 parent 80cfe95 commit e17e9ed

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/browser/telemetryReporter.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,11 @@ const webAppInsightsClientFactory = async (key: string, replacementOptions?: Rep
4343
appInsightsClient?.flush(false);
4444
},
4545
dispose: async () => {
46-
appInsightsClient?.flush(true);
4746
const unloadPromise = new Promise<void>((resolve) => {
4847
appInsightsClient?.unload(true, () => {
4948
resolve();
5049
appInsightsClient = undefined;
51-
});
50+
}, 1000);
5251
}
5352
);
5453
return unloadPromise;

src/common/1dsClientFactory.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,16 @@ export const oneDataSystemClientFactory = async (key: string, vscodeAPI: typeof
103103
},
104104
flush: flushOneDS,
105105
dispose: async () => {
106-
await flushOneDS();
107106
const disposePromise = new Promise<void>((resolve) => {
108107
if (!appInsightsCore) {
109108
resolve();
110109
return;
111110
}
112-
appInsightsCore.unload(true, () => {
111+
appInsightsCore.unload(false, () => {
113112
resolve();
114113
appInsightsCore = undefined;
115114
return;
116-
});
115+
}, 1000);
117116
});
118117
return disposePromise;
119118
}

src/node/telemetryReporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const appInsightsClientFactory = async (key: string, replacementOptions?: Replac
7979
}
8080
},
8181
dispose: async () => {
82-
appInsightsClient?.flush();
82+
appInsightsClient?.flush({ isAppCrashing: true });
8383
appInsightsClient = undefined;
8484
}
8585
};

0 commit comments

Comments
 (0)