Skip to content

Commit

Permalink
Flush diagnostics client
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKert committed Apr 27, 2019
1 parent a38259f commit ea508d5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/BuildVision.Common/Diagnostics/DiagnosticsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void Initialize(string edition, string vsVersion, string apiKey)
}
}

public static void OnExit()
public static void Flush()
{
if (!_initialized || !ParticipateInTelemetry)
{
Expand Down
3 changes: 3 additions & 0 deletions src/BuildVision/Core/BuildVisionPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ private void Current_DispatcherUnhandledException(object sender, DispatcherUnhan
{
_logger.Fatal(e.Exception, "Unhandled Exception");
DiagnosticsClient.TrackException(e.Exception);
DiagnosticsClient.Flush();
}

protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
Expand Down Expand Up @@ -154,6 +155,8 @@ private void SolutionEvents_AfterClosing()

_solutionBuildManager.UnadviseUpdateSolutionEvents(_updateSolutionEventsCookie);
_solutionBuildManager4.UnadviseUpdateSolutionEvents4(_updateSolutionEvents4Cookie);

DiagnosticsClient.Flush();
}

private void CommandEvents_AfterExecute(string guid, int id, object customIn, object customOut)
Expand Down
2 changes: 1 addition & 1 deletion src/BuildVision/Core/BuildVisionPane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async Task<BuildVisionPaneViewModel> InitializeAsync(AsyncPackage asyncPackage)
_controlCreatedSuccessfully = true;

DiagnosticsClient.TrackEvent("BuildVisionStarted");

DiagnosticsClient.Flush();
return viewModel;
}
catch (Exception e)
Expand Down

0 comments on commit ea508d5

Please sign in to comment.