Merge branch 'dev' into pr_2949

This commit is contained in:
Nick O'Leary
2021-04-27 10:45:33 +01:00
9 changed files with 24 additions and 20 deletions

View File

@@ -16,7 +16,7 @@
module.exports = function(RED) {
"use strict";
var cron = require("cron");
const {scheduleTask} = require("cronosjs");
function InjectNode(n) {
RED.nodes.createNode(this,n);
@@ -85,7 +85,7 @@ module.exports = function(RED) {
if (RED.settings.verbose) {
this.log(RED._("inject.crontab", this));
}
this.cronjob = new cron.CronJob(this.crontab, function() { node.emit("input", {}); }, null, true);
this.cronjob = scheduleTask(this.crontab,() => { node.emit("input", {})});
}
};