Last active
October 12, 2015 04:25
-
-
Save neilrenicker/f03847d07561d547a6e9 to your computer and use it in GitHub Desktop.
article: https://medium.com/p/c902269fd11e/ -- Automate Stuff With A Dead Simple Node Worker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reference the node-schedule npm package. | |
var schedule = require('node-schedule'); | |
var APP = { | |
scheduleJob: function() { | |
// This rule is standard cron syntax for once per minute. | |
// See http://stackoverflow.com/a/5398044/1252653 | |
rule = '* * * * *' | |
// Kick off the job | |
var job = schedule.scheduleJob(rule, function() { | |
console.log('ping!') | |
}); | |
}, | |
init: function() { | |
APP.scheduleJob(); | |
} | |
}; | |
(function(){ | |
APP.init(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment