From 42324ab9da6df1c07e00a4e3c2d9d84de681287c Mon Sep 17 00:00:00 2001 From: Adam Gorman Date: Mon, 2 May 2016 14:03:03 -0700 Subject: [PATCH] Removing accidental duplicate code --- src/dotnet/Telemetry.cs | 41 ++--------------------------------------- 1 file changed, 2 insertions(+), 39 deletions(-) diff --git a/src/dotnet/Telemetry.cs b/src/dotnet/Telemetry.cs index 493aaacd5..e10cc48eb 100644 --- a/src/dotnet/Telemetry.cs +++ b/src/dotnet/Telemetry.cs @@ -58,41 +58,6 @@ namespace Microsoft.DotNet.Cli return; } - _isCollectingTelemetry = true; - try - { - //initialize in task to offload to parallel thread - _trackEventTask = Task.Factory.StartNew(() => InitializeTelemetry()); - } - catch(Exception) - { - Debug.Fail("Exception during telemetry task initialization"); - } - } - - public void TrackEvent(string eventName, IList properties, IDictionary measurements) - { - if (!_isCollectingTelemetry) - { - return; - } - - try - { - _trackEventTask = _trackEventTask.ContinueWith( - x => TrackEventTask(eventName, - properties, - measurements) - ); - } - catch(Exception) - { - Debug.Fail("Exception during telemetry task continuation"); - } - } - - private void InitializeTelemetry() - { try { using (PerfTrace.Current.CaptureTiming()) @@ -101,11 +66,9 @@ namespace Microsoft.DotNet.Cli _trackEventTask = Task.Factory.StartNew(() => InitializeTelemetry()); } } - catch (Exception) + catch(Exception) { - // we dont want to fail the tool if telemetry fais. We should be able to detect abnormalities from data - // at the server end - Debug.Fail("Exception during telemetry initialization"); + Debug.Fail("Exception during telemetry task initialization"); } }