Changed configuration of first run time for health check notifier from a time string to a cron expression.

This commit is contained in:
Andy Butland
2020-10-31 22:49:12 +01:00
parent bdb8f34da3
commit a0ce44c9fc
10 changed files with 42 additions and 112 deletions

View File

@@ -42,11 +42,11 @@ namespace Umbraco.Core.Configuration.Models.Validation
return true;
}
public bool ValidateOptionalTime(string configPath, string value, out string message)
public bool ValidateOptionalCronTab(string configPath, string value, out string message)
{
if (!string.IsNullOrEmpty(value) && !value.IsValidTimeSpan())
if (!string.IsNullOrEmpty(value) && !value.IsValidCronTab())
{
message = $"Configuration entry {configPath} contains an invalid time value.";
message = $"Configuration entry {configPath} contains an invalid cron expression.";
return false;
}

View File

@@ -16,7 +16,7 @@ namespace Umbraco.Core.Configuration.Models.Validation
private bool ValidateNotificationFirstRunTime(string value, out string message)
{
return ValidateOptionalTime($"{Constants.Configuration.ConfigHealthChecks}:{nameof(HealthChecksSettings.Notification)}:{nameof(HealthChecksSettings.Notification.FirstRunTime)}", value, out message);
return ValidateOptionalCronTab($"{Constants.Configuration.ConfigHealthChecks}:{nameof(HealthChecksSettings.Notification)}:{nameof(HealthChecksSettings.Notification.FirstRunTime)}", value, out message);
}
}
}