From e5fa098d66e5e725e92c1446b899564d2cb45483 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sun, 12 Feb 2012 23:49:53 -0800 Subject: [PATCH] deskmetrics doesn't report during dev. --- NzbDrone.Core/CentralDispatch.cs | 10 +++++++--- NzbDrone.Core/Jobs/CheckpointJob.cs | 6 +++++- NzbDrone.Core/Providers/AnalyticsProvider.cs | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/NzbDrone.Core/CentralDispatch.cs b/NzbDrone.Core/CentralDispatch.cs index b6b427a9c..095f8759f 100644 --- a/NzbDrone.Core/CentralDispatch.cs +++ b/NzbDrone.Core/CentralDispatch.cs @@ -64,13 +64,17 @@ namespace NzbDrone.Core ReportingService.RestProvider = Kernel.Get(); var appId = AnalyticsProvider.DESKMETRICS_TEST_ID; - + if (EnviromentProvider.IsProduction) appId = AnalyticsProvider.DESKMETRICS_PRODUCTION_ID; var deskMetricsClient = new DeskMetricsClient(Kernel.Get().UGuid.ToString(), appId, _enviromentProvider.Version); Kernel.Bind().ToConstant(deskMetricsClient); - Kernel.Get().Checkpoint(); + + if (EnviromentProvider.IsProduction) + { + Kernel.Get().Checkpoint(); + } } private void InitQuality() @@ -119,7 +123,7 @@ namespace NzbDrone.Core Kernel.Bind().To().InSingletonScope(); Kernel.Bind().To().InSingletonScope(); Kernel.Bind().To().InSingletonScope(); - + Kernel.Get().Initialize(); Kernel.Get().StartTimer(30); } diff --git a/NzbDrone.Core/Jobs/CheckpointJob.cs b/NzbDrone.Core/Jobs/CheckpointJob.cs index b5ca4082c..533dee48e 100644 --- a/NzbDrone.Core/Jobs/CheckpointJob.cs +++ b/NzbDrone.Core/Jobs/CheckpointJob.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using Ninject; +using NzbDrone.Common; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; @@ -33,7 +34,10 @@ namespace NzbDrone.Core.Jobs public void Start(ProgressNotification notification, int targetId, int secondaryTargetId) { - _analyticsProvider.Checkpoint(); + if(EnviromentProvider.IsProduction) + { + _analyticsProvider.Checkpoint(); + } } } } \ No newline at end of file diff --git a/NzbDrone.Core/Providers/AnalyticsProvider.cs b/NzbDrone.Core/Providers/AnalyticsProvider.cs index e40f9b711..effe88f41 100644 --- a/NzbDrone.Core/Providers/AnalyticsProvider.cs +++ b/NzbDrone.Core/Providers/AnalyticsProvider.cs @@ -34,7 +34,7 @@ namespace NzbDrone.Core.Providers try { //Don't report anything unless working from master branch. - if (!IsOnMasterBranch() || !EnviromentProvider.IsProduction) + if (!IsOnMasterBranch()) return; if (EnviromentProvider.IsNewInstall)