Skip to content

Commit

Permalink
fix: startup script to point to the correct file
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanwalther committed Sep 20, 2017
1 parent b92a79a commit 71ea6a0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
38 changes: 19 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"lint:test": "eslint test",
"lint:test:fix": "eslint test --fix",
"prepush": "npm run docs-if-necessary",
"start": "node ./index.js",
"start:watch": "npm install nodemon -g && nodemon ./src/index.js",
"start": "node ./src/index.js",
"start:watch": "(npm list nodemon -g || npm install nodemon -g) && nodemon ./src/index.js",
"test": "npm run test:integration",
"test:integration": "mocha './test/integration/**/*.spec.js' --require './test/mocha.conf.js' --timeout 6000"
},
Expand All @@ -47,7 +47,7 @@
},
"devDependencies": {
"chai": "^4.1.2",
"eslint": "^4.7.0",
"eslint": "^4.7.1",
"eslint-config-space-single": "^0.2.0",
"http-status-codes": "^1.3.0",
"husky": "^0.14.3",
Expand Down
3 changes: 3 additions & 0 deletions src/modules/cmd-cron/cmd-cron.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ const schedule = require('node-schedule');

class CmdController {

// Todo: Definitely not a get ;-)
static get(req, res) {

let cron = req.query.cron || '* * * * *'; // Defaults to every minute
let cmdToExec = req.query.def || 'echo This is the echo result of the cron job';

logger.trace('Crating cron job:', cmdToExec, cron);

// Todo: Store them in memory, so we can cancel them afterwards
schedule.scheduleJob(cron, () => {
exec(cmdToExec, (err, stdout /* , stderr */) => {
if (err) {
Expand Down

0 comments on commit 71ea6a0

Please sign in to comment.