0.0.6 • Published 8 years ago
stop-agenda v0.0.6
stop-agenda
Gracefully stop Agenda and cancel recurring jobs
Table of Contents
Install
npm:
npm install stop-agendayarn:
yarn add stop-agendaUsage
You should probably be using Lad's agenda directly instead of this package.
With default options:
const stopAgenda = require('stop-agenda');
const Agenda = require('agenda');
const agenda = new Agenda();
stopAgenda(agenda).then().catch(console.error);With advanced options including custom cancel query
cancelQueryand check interval in millisecondscheckIntervalMs:
const stopAgenda = require('stop-agenda');
const Agenda = require('agenda');
const agenda = new Agenda();
stopAgenda(agenda, {
cancelQuery: {
repeatInterval: {
$exists: true,
$ne: null
}
},
checkIntervalMs: 300
}).then().catch(console.error);Options
stopAgendaaccepts two arguments(agenda, config)and returns aPromise:
agenda(required) - a valid instance of Agendaconfig(optional) - a configuration object which defaults to:{ cancelQuery: { repeatInterval: { $exists: true, $ne: null } }, // (uses `process.env.STOP_AGENDA_CHECK_INTERVAL` if set) checkIntervalMs: 500 }
Contributors
| Name | Website |
|---|---|
| Nick Baugh | http://niftylettuce.com/ |