Ability to update settings. Take effect on next reboot.

This commit is contained in:
Joseph Milazzo 2021-02-04 16:49:48 -06:00
parent e60f795410
commit 1050fa4e54
21 changed files with 953 additions and 146 deletions

View file

@ -0,0 +1,41 @@
using System.Collections.Generic;
using Hangfire;
namespace API.Helpers.Converters
{
public static class CronConverter
{
public static readonly IEnumerable<string> Options = new []
{
"disabled",
"daily",
"weekly",
};
public static string ConvertToCronNotation(string source)
{
string destination = "";
destination = source.ToLower() switch
{
"daily" => Cron.Daily(),
"weekly" => Cron.Weekly(),
"disabled" => Cron.Never(),
"" => Cron.Never(),
_ => destination
};
return destination;
}
public static string ConvertFromCronNotation(string cronNotation)
{
string destination = "";
destination = cronNotation.ToLower() switch
{
"0 0 31 2 *" => "disabled",
_ => destination
};
return destination;
}
}
}