Created
June 20, 2015 06:19
-
-
Save hotakasaito/83855606773ee7cc7548 to your computer and use it in GitHub Desktop.
herokuのnode.jsでagendaを使う ref: http://qiita.com/hotakasaito/items/5fad6c445fe3d5d64d9a
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
heroku addons:create mongolab:sandbox |
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
Agenda = require('agenda') | |
agenda = new Agenda({db: { address: process.env.MONGOLAB_URI ? 'localhost:27017/agenda'}}) | |
module.exports = (robot) -> | |
agenda.define 'agenda:task1', (job, done) -> | |
# tasks | |
agenda.now('agenda:task1') | |
agenda.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment