🐛 Fixed cron expression to read seconds parameter
no issue - When providing a crontab schedule expression it should always contain 6 elements first one of them being a "seconds" schedule description . For example: '0/5 * * * * *' - meaning to run every 5 seconds
This commit is contained in:
parent
a8cb12250b
commit
c0cecd71fe
@ -23,7 +23,12 @@ const cronValidate = require('cron-validate');
|
||||
* @returns {boolean} wheather or not the expression is valid
|
||||
*/
|
||||
const isCronExpression = (expression) => {
|
||||
let cronResult = cronValidate(expression);
|
||||
let cronResult = cronValidate(expression, {
|
||||
preset: 'default', // second field not supported in default preset
|
||||
override: {
|
||||
useSeconds: true // override preset option
|
||||
}
|
||||
});
|
||||
|
||||
return cronResult.isValid();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user