Merge pull request #2959 from node-red/inject-cronosjs

Move Inject node to CronosJS module
This commit is contained in:
Nick O'Leary 2021-04-27 10:44:22 +01:00 committed by GitHub
commit d6ccae38f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -37,7 +37,7 @@
"cookie": "0.4.1",
"cookie-parser": "1.4.5",
"cors": "2.8.5",
"cron": "1.7.2",
"cronosjs": "1.7.1",
"denque": "1.5.0",
"express": "4.17.1",
"express-session": "1.17.1",

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", {})});
}
};

View File

@ -22,7 +22,7 @@
"cookie-parser": "1.4.5",
"cookie": "0.4.1",
"cors": "2.8.5",
"cron": "1.7.2",
"cronosjs": "1.7.1",
"denque": "1.5.0",
"fs-extra": "9.1.0",
"fs.notify": "0.0.4",