Makes jobs default to 'disabled' when created or edited, to prevent inadvertant executions

pull/164/head
Sean Doyle 2021-07-09 12:31:05 -06:00
parent a0644b9059
commit 4669eb35c1
1 changed files with 2 additions and 2 deletions

View File

@ -44,14 +44,14 @@ crontab = function(name, command, schedule, stopped, logging, mailing){
}; };
exports.create_new = function(name, command, schedule, logging, mailing){ exports.create_new = function(name, command, schedule, logging, mailing){
var tab = crontab(name, command, schedule, false, logging, mailing); var tab = crontab(name, command, schedule, true, logging, mailing);
tab.created = new Date().valueOf(); tab.created = new Date().valueOf();
tab.saved = false; tab.saved = false;
db.insert(tab); db.insert(tab);
}; };
exports.update = function(data){ exports.update = function(data){
var tab = crontab(data.name, data.command, data.schedule, null, data.logging, data.mailing); var tab = crontab(data.name, data.command, data.schedule, true, data.logging, data.mailing);
tab.saved = false; tab.saved = false;
db.update({_id: data._id}, tab); db.update({_id: data._id}, tab);
}; };