Skip to content

Instantly share code, notes, and snippets.

@oscarmcm
Created September 2, 2014 21:57
Show Gist options
  • Save oscarmcm/b40e481cd1e852457307 to your computer and use it in GitHub Desktop.
Save oscarmcm/b40e481cd1e852457307 to your computer and use it in GitHub Desktop.
{
"name": "HelloWorld",
"author": "Oscar Cortez",
"version": "0.0.1",
"description": "Agenda Sample Application",
"dependencies": {
"agenda": "*"
},
"engine": "node 0.10.x"
}
Agenda = require('agenda');
var agenda = new Agenda({db: {address: 'localhost:27017/agenda-example'}});
agenda.define('greet the world', function(job, done) {
console.log(job.attrs.data.time, 'hello world!');
done();
});
agenda.schedule('in 10 seconds', 'greet the world', {time: new Date()});
agenda.start();
console.log('Wait 10 seconds...');
@paulomcnally
Copy link

bad
Agenda = require('agenda');

Good
var Agenda = require('agenda');

@oscarmcm
Copy link
Author

oscarmcm commented Jan 6, 2015

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment