Skip to content

Commit

Permalink
chore: bump croner to 4.3.10, enable cron legacy mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed May 9, 2022
1 parent e35684e commit ce68797
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,11 @@ Common.sink.determineCron = function(app) {
}

if (app.cron_restart) {
const Croner = require('croner');
const Cron = require('croner');

try {
Common.printOut(cst.PREFIX_MSG + 'cron restart at ' + app.cron_restart);
Croner(app.cron_restart);
Cron(app.cron_restart, { legacyMode: true });
} catch(ex) {
return new Error(`Cron pattern error: ${ex.message}`);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = function(God) {
var pm_id = pm2_env.pm_id
console.log('[PM2][WORKER] Registering a cron job on:', pm_id);

var job = Cron(pm2_env.cron_restart, function() {
var job = Cron(pm2_env.cron_restart, { legacyMode: true }, function() {
God.restartProcessId({id: pm_id}, function(err, data) {
if (err)
console.error(err.stack || err);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
"chokidar": "^3.5.1",
"cli-tableau": "^2.0.0",
"commander": "2.15.1",
"croner": "~4.1.92",
"croner": "~4.2.0",
"dayjs": "~1.8.25",
"debug": "^4.3.1",
"enquirer": "2.3.6",
Expand Down

0 comments on commit ce68797

Please sign in to comment.