1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-23 02:05:27 +02:00

Fixed: Prevent lack of internet from stopping all health checks from running

This commit is contained in:
Mark McDowall 2024-11-18 16:51:28 -08:00
parent b51a490979
commit dba3a82439

View File

@ -22,6 +22,8 @@ public SystemTimeCheck(IHttpClient client, ISonarrCloudRequestBuilder cloudReque
}
public override HealthCheck Check()
{
try
{
var request = _cloudRequestBuilder.Create()
.Resource("/time")
@ -37,6 +39,11 @@ public override HealthCheck Check()
_logger.Error("System time mismatch. SystemTime: {0} Expected Time: {1}. Update system time", systemTime, result.DateTimeUtc);
return new HealthCheck(GetType(), HealthCheckResult.Error, _localizationService.GetLocalizedString("SystemTimeHealthCheckMessage"), "#system-time-off");
}
}
catch (Exception e)
{
_logger.Warn(e, "Unable to verify system time");
}
return new HealthCheck(GetType());
}