Customized Scheduler + Saved Kavita+ Details (#2644)
This commit is contained in:
parent
2092e120c3
commit
ad74871623
76 changed files with 6076 additions and 3370 deletions
22
Kavita.Common/Helpers/CronHelper.cs
Normal file
22
Kavita.Common/Helpers/CronHelper.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using Cronos;
|
||||
|
||||
namespace Kavita.Common.Helpers;
|
||||
|
||||
public static class CronHelper
|
||||
{
|
||||
public static bool IsValidCron(string cronExpression)
|
||||
{
|
||||
// NOTE: This must match Hangfire's underlying cron system. Hangfire is unique
|
||||
try
|
||||
{
|
||||
CronExpression.Parse(cronExpression);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
/* Swallow */
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue