mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Move Inject node to CronosJS module
This commit is contained in:
parent
b62e4f6662
commit
ea50ba16f9
@ -37,7 +37,7 @@
|
|||||||
"cookie": "0.4.1",
|
"cookie": "0.4.1",
|
||||||
"cookie-parser": "1.4.5",
|
"cookie-parser": "1.4.5",
|
||||||
"cors": "2.8.5",
|
"cors": "2.8.5",
|
||||||
"cron": "1.7.2",
|
"cronosjs": "1.7.1",
|
||||||
"denque": "1.5.0",
|
"denque": "1.5.0",
|
||||||
"express": "4.17.1",
|
"express": "4.17.1",
|
||||||
"express-session": "1.17.1",
|
"express-session": "1.17.1",
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
module.exports = function(RED) {
|
module.exports = function(RED) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var cron = require("cron");
|
const {scheduleTask} = require("cronosjs");
|
||||||
|
|
||||||
function InjectNode(n) {
|
function InjectNode(n) {
|
||||||
RED.nodes.createNode(this,n);
|
RED.nodes.createNode(this,n);
|
||||||
@ -85,7 +85,7 @@ module.exports = function(RED) {
|
|||||||
if (RED.settings.verbose) {
|
if (RED.settings.verbose) {
|
||||||
this.log(RED._("inject.crontab", this));
|
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", {})});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"cookie-parser": "1.4.5",
|
"cookie-parser": "1.4.5",
|
||||||
"cookie": "0.4.1",
|
"cookie": "0.4.1",
|
||||||
"cors": "2.8.5",
|
"cors": "2.8.5",
|
||||||
"cron": "1.7.2",
|
"cronosjs": "1.7.1",
|
||||||
"denque": "1.5.0",
|
"denque": "1.5.0",
|
||||||
"fs-extra": "9.1.0",
|
"fs-extra": "9.1.0",
|
||||||
"fs.notify": "0.0.4",
|
"fs.notify": "0.0.4",
|
||||||
|
Loading…
Reference in New Issue
Block a user