From 6d6e7d5991a955105c22bdb2bbe8869627646580 Mon Sep 17 00:00:00 2001 From: shediao Date: Thu, 29 Mar 2018 18:19:59 +0800 Subject: [PATCH] Sometimes crontab configuration does not take effect --- crontab.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/crontab.js b/crontab.js index b32887a..ca88fc4 100644 --- a/crontab.js +++ b/crontab.js @@ -122,16 +122,11 @@ exports.set_crontab = function(env_vars, callback){ } fs.writeFile(path.join(cronPath, fileName), crontab_string, function(err) { if (err) return callback(err); - /// In docker we're running crond using busybox implementation of crond - /// It is launched as part of the container startup process, so no need to run it again - if(process.env.CRON_IN_DOCKER === undefined) { - exec("crontab " + path.join(cronPath, "crontab"), function(err) { - if (err) return callback(err); - else callback(); - }); - } else { - callback(); - } + + exec("crontab " + path.join(cronPath, fileName), function(err) { + if (err) return callback(err); + else callback(); + }); }); }); });