Sometimes crontab configuration does not take effect

pull/74/head
shediao 2018-03-29 18:19:59 +08:00 committed by GitHub
parent a84171ac11
commit 6d6e7d5991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 10 deletions

View File

@ -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();
});
});
});
});