new:dev:support run the jobs manually

This commit is contained in:
chenqiyu
2018-05-07 18:40:41 +08:00
parent a84171ac11
commit bb7f57e903
5 changed files with 26 additions and 0 deletions

6
app.js
View File

@@ -87,6 +87,12 @@ app.post(routes.remove, function(req, res) {
res.end();
});
// run a job
app.post(routes.run, function(req, res) {
crontab.runjob(req.body._id);
res.end();
});
// set crontab. Needs env_vars to be passed
app.get(routes.crontab, function(req, res, next) {
crontab.set_crontab(req.query.env_vars, function(err) {