Questions tagged [agenda]

Agenda is a light-weight job scheduling library for Node.js, with a Mongo persistence layer.

Agenda is a light-weight job scheduling library for Node.js.

It offers:

  • Minimal overhead. Agenda aims to keep its code base small.
  • Mongo backed persistance layer.
  • Promises based API
  • Scheduling with configurable priority, concurrency, and repeating
  • Scheduling via cron or human readable syntax.
  • Event backed job queue that you can hook into.
  • Optional standalone web-interfaces (see agendash and agenda-ui)

Installation

Install via NPM

npm install agenda

You will also need a working mongo database (2.6+) to point it to.

Example Usage

var mongoConnectionString = "mongodb://127.0.0.1/agenda";

var agenda = new Agenda({db: {address: mongoConnectionString}});

// or override the default collection name:
// var agenda = new Agenda({db: {address: mongoConnectionString, collection: "jobCollectionName"}});

// or pass additional connection options:
// var agenda = new Agenda({db: {address: mongoConnectionString, collection: "jobCollectionName", options: {server:{auto_reconnect:true}}}});

// or pass in an existing mongodb-native MongoClient instance
// var agenda = new Agenda({mongo: myMongoClient});

agenda.define('delete old users', function(job, done) {
  User.remove({lastLogIn: { $lt: twoDaysAgo }}, done);
});

agenda.on('ready', function() {
  agenda.every('3 minutes', 'delete old users');

  // Alternatively, you could also do:
  agenda.every('*/3 * * * *', 'delete old users');

  agenda.start();
});

More Info:

https://github.com/agenda/agenda

98 questions
0
votes
0 answers

Fullcalendar fc-time with custom color

I am programming an appoiment calendar for a beauty center. I am using Symfony and fullCalendar in agendaView. I need each event(appointment) to have two colors: 1.-The color of the type of treatment (fc-title background color) and the other 2.-The…
Mlgarate
  • 11
  • 3
0
votes
1 answer

Setup agenda jobs every monday

I want to run a job on every Monday once. I tried agenda.every('* * * * * 1', 'Weekly keyworker report'); But it executes a every seconds.I am confused to use that. I am working based on this package.
Sakthivel
  • 139
  • 1
  • 16
0
votes
1 answer

How to track email from to your codeigniter app

I'm writing an application with codeigniter, which is clearly done but I just want 1 more plugin in it. I would like to catch all the emails from my outlook account to my codeigniter app. It would be awesome if I could send and receive messages on…
Anel Hegic
  • 25
  • 8
0
votes
0 answers

agenda npm runs only 4 times

I need a job scheduler that runs a couple of jobs in a specific time interval. So, I used agenda module for doing this task. What happens is when the server is restarted the jobs get executed and this happens for 4 times in regular interval basis…
Ashish Shetty
  • 456
  • 1
  • 4
  • 8
0
votes
1 answer

Mysql best index(es) for an agenda table

CREATE TABLE IF NOT EXISTS `agenda` ( `id_agenda` int(11) NOT NULL AUTO_INCREMENT, `id_user` int(11) NOT NULL DEFAULT '0', `id_customer` int(11) DEFAULT NULL, `type` int(11) NOT NULL DEFAULT '8', `title` varchar(255) NOT NULL DEFAULT '', …
Jung
  • 63
  • 1
  • 8
0
votes
1 answer

schedule job at a particular time using agenda node js

I want to schedule job at a particular time using agenda node js var agenda = new Agenda(); agenda.define('initA', function(job) { console.log("INITA AGENDA"); job.repeatAt('at 13:25'); job.save(); }); agenda.on('ready', function() { …
Jaini
  • 90
  • 10
0
votes
1 answer

Nodejs Scheduler (Agenda) with co - no callback

I am using Agenda 0.9.0, mongoose 4.7.5, co 4.6.5, for some unknown reason done() is never called in none of the places. The job is timing out and is run every 10 s instead of 2 (if i don't override default 10 minutes, it will run every 10…
gad0lin
  • 111
  • 2
  • 9
0
votes
1 answer

How to wrap Agenda in express apiRoutes in nodejs

I want to schedule a simple task using Agenda with nodejs, however it is not executing when it is wrapped in apiRoutes (express router) var apiRoutes = express.Router(); app.use('/api', apiRoutes); apiRoutes.post('/scheduler/submit', function (req,…
digit
  • 4,479
  • 3
  • 24
  • 43
1 2 3 4 5 6
7