From bb2548a08d5b36ad520a59f6cb957762a646a54e Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 26 Dec 2024 12:37:45 -0800 Subject: [PATCH] Don't send session information to Sentry (cherry picked from commit fae24e98fb9230c2f3701caef457332952c6723f) --- .../Instrumentation/Sentry/SentryTarget.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs b/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs index 843f904a6..3a4737f74 100644 --- a/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs +++ b/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs @@ -119,7 +119,7 @@ namespace NzbDrone.Common.Instrumentation.Sentry o.Environment = BuildInfo.Branch; // Crash free run statistics (sends a ping for healthy and for crashes sessions) - o.AutoSessionTracking = true; + o.AutoSessionTracking = false; // Caches files in the event device is offline // Sentry creates a 'sentry' sub directory, no need to concat here @@ -148,7 +148,7 @@ namespace NzbDrone.Common.Instrumentation.Sentry _debounce = new SentryDebounce(); // initialize to true and reconfigure later - // Otherwise it will default to false and any errors occuring + // Otherwise it will default to false and any errors occurring // before config file gets read will not be filtered FilterEvents = true; SentryEnabled = true; @@ -207,9 +207,7 @@ namespace NzbDrone.Common.Instrumentation.Sentry private void OnError(Exception ex) { - var webException = ex as WebException; - - if (webException != null) + if (ex is WebException webException) { var response = webException.Response as HttpWebResponse; var statusCode = response?.StatusCode;