Browse Source

cleanup

pull/18/head
alseambusher 8 years ago
parent
commit
d59e2b5ea9
  1. 2
      crontab.js
  2. 5
      restore.js
  3. 2
      routes.js

2
crontab.js

@ -16,7 +16,7 @@ crontab = function(name, command, schedule, stopped, logging){
data.name = name; data.name = name;
data.command = command; data.command = command;
data.schedule = schedule; data.schedule = schedule;
if(stopped != null) { if(stopped !== null) {
data.stopped = stopped; data.stopped = stopped;
} }
data.timestamp = (new Date()).toString(); data.timestamp = (new Date()).toString();

5
restore.js

@ -11,9 +11,8 @@ exports.crontabs = function(db_name, callback){
db.find({}).sort({ created: -1 }).exec(function(err, docs){ db.find({}).sort({ created: -1 }).exec(function(err, docs){
callback(docs); callback(docs);
}); });
} };
exports.delete = function(db_name){ exports.delete = function(db_name){
fs.unlink(__dirname + '/crontabs/' + db_name); fs.unlink(__dirname + '/crontabs/' + db_name);
} };

2
routes.js

@ -13,4 +13,4 @@ exports.routes = {
"import": "/import", // this is import from database "import": "/import", // this is import from database
"import_crontab": "/import_crontab", // this is from existing crontab "import_crontab": "/import_crontab", // this is from existing crontab
"logger": "/logger", "logger": "/logger",
} };

Loading…
Cancel
Save