Skip to content

Commit

Permalink
refactor: Stop telemetry collection after app quit
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Dec 1, 2024
1 parent 9b9c7f9 commit 2ec212b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion xmcl-runtime/telemetry/pluginTelemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ export const pluginTelemetry: LauncherAppPlugin = async (app) => {
client.trackEvent({
name: 'app-stop',
})
client.flush()
await new Promise((resolve) => {
client.flush({
callback: resolve,
})
})
appInsight.dispose()
})

app.on('service-call-end', (serviceName, serviceMethod, duration, success) => {
Expand Down

0 comments on commit 2ec212b

Please sign in to comment.