21 lines
481 B
C#
21 lines
481 B
C#
using NCrontab;
|
|
|
|
namespace LCU.API.Internal.Operations.IncentiveApi.Utilities;
|
|
|
|
public static class CronHelpers
|
|
{
|
|
public static CrontabSchedule SetCronSchedule(string cron, string cronDefault)
|
|
{
|
|
try
|
|
{
|
|
return CrontabSchedule.Parse(cron);
|
|
}
|
|
catch (Exception exception)
|
|
{
|
|
Log.Error(exception, "Failure parsing cron-tab in appsettings.");
|
|
return CrontabSchedule.Parse(cronDefault);
|
|
}
|
|
}
|
|
}
|
|
|