diff --git a/package.json b/package.json index 9df66ddf4..573c76ee1 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/node_modules/@node-red/nodes/core/common/20-inject.js b/packages/node_modules/@node-red/nodes/core/common/20-inject.js index b1db94ff5..772e238a3 100644 --- a/packages/node_modules/@node-red/nodes/core/common/20-inject.js +++ b/packages/node_modules/@node-red/nodes/core/common/20-inject.js @@ -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", {})}); } }; diff --git a/packages/node_modules/@node-red/nodes/package.json b/packages/node_modules/@node-red/nodes/package.json index a1a8fc5ce..c46d4f975 100644 --- a/packages/node_modules/@node-red/nodes/package.json +++ b/packages/node_modules/@node-red/nodes/package.json @@ -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",