diff --git a/src/NzbDrone.Core/HealthCheck/Checks/SystemTimeCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/SystemTimeCheck.cs index a761f90df..8ee1f5a30 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/SystemTimeCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/SystemTimeCheck.cs @@ -1,6 +1,7 @@ using System; using NLog; using NzbDrone.Common.Cloud; +using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.Http; using NzbDrone.Common.Serializer; using NzbDrone.Core.Localization; @@ -23,9 +24,14 @@ namespace NzbDrone.Core.HealthCheck.Checks public override HealthCheck Check() { + if (BuildInfo.IsDebug) + { + return new HealthCheck(GetType()); + } + var request = _cloudRequestBuilder.Create() - .Resource("/time") - .Build(); + .Resource("/time") + .Build(); var response = _client.Execute(request); var result = Json.Deserialize(response.Content); diff --git a/src/NzbDrone.Core/HealthCheck/ServerSideNotificationService.cs b/src/NzbDrone.Core/HealthCheck/ServerSideNotificationService.cs index 11ed87da9..dd742bdf6 100644 --- a/src/NzbDrone.Core/HealthCheck/ServerSideNotificationService.cs +++ b/src/NzbDrone.Core/HealthCheck/ServerSideNotificationService.cs @@ -42,19 +42,25 @@ namespace NzbDrone.Core.HealthCheck public List GetServerChecks() { - return _cache.Get("ServerChecks", () => RetrieveServerChecks(), TimeSpan.FromHours(2)); + return _cache.Get("ServerChecks", RetrieveServerChecks, TimeSpan.FromHours(2)); } private List RetrieveServerChecks() { + if (BuildInfo.IsDebug) + { + return new List(); + } + var request = _cloudRequestBuilder.Create() - .Resource("/notification") - .AddQueryParam("version", BuildInfo.Version) - .AddQueryParam("os", OsInfo.Os.ToString().ToLowerInvariant()) - .AddQueryParam("arch", RuntimeInformation.OSArchitecture) - .AddQueryParam("runtime", "netcore") - .AddQueryParam("branch", _configFileProvider.Branch) - .Build(); + .Resource("/notification") + .AddQueryParam("version", BuildInfo.Version) + .AddQueryParam("os", OsInfo.Os.ToString().ToLowerInvariant()) + .AddQueryParam("arch", RuntimeInformation.OSArchitecture) + .AddQueryParam("runtime", "netcore") + .AddQueryParam("branch", _configFileProvider.Branch) + .Build(); + try { _logger.Trace("Getting server side health notifications"); @@ -65,8 +71,9 @@ namespace NzbDrone.Core.HealthCheck catch (Exception ex) { _logger.Error(ex, "Failed to retrieve server notifications"); - return new List(); } + + return new List(); } }