Socket
Socket
Sign inDemoInstall

@ladjs/agenda

Package Overview
Dependencies
18
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ladjs/agenda

Agenda for Lad


Version published
Weekly downloads
1
Maintainers
3
Created
Weekly downloads
 

Readme

Source

@ladjs/agenda

build status code coverage code style styled with prettier made with lass license

Agenda for Lad

Table of Contents

Install

npm:

npm install @ladjs/agenda

yarn:

yarn add @ladjs/agenda

Usage

This package serves as a drop-in replacement for a normal Agenda require() call. It carries the same exact API and returns the same Agenda instance that it normally would (except it adds some extra glue on top, such as built-in integration of stop-agenda).

Default options are shown below:

#!/usr/bin/env node
const Agenda = require('@ladjs/agenda');
const mongoose = require('@ladjs/mongoose');
const Graceful = require('@ladjs/graceful');

const agenda = new Agenda();
agenda.configure({
  logger: console,
  // these are options passed directly to `stop-agenda`
  // <https://github.com/ladjs/stop-agenda>
  stopAgenda: {
    cancelQuery: {
      repeatInterval: {
        $exists: true,
        $ne: null
      }
    }
  },
  // these are jobs defined via `config.jobs`
  // e.g. `agendaJobDefinitions: [ [name, agendaOptions, fn], ... ]`
  agendaJobDefinitions: [],
  // these get automatically invoked to `agenda.every`
  // e.g. `agenda.every('5 minutes', 'locales')`
  // and you define them as [ interval, job name ]
  // you need to define them here for graceful handling
  // e.g. `agendaRecurringJobs: [ ['5 minutes', 'locales' ], ... ]`
  agendaRecurringJobs: [],
  // these get automatically invoked when process starts
  // e.g. `agenda.now('locales');`
  // and you define them as Strings in the array
  // e.g. `config.now: ['locales','ping','pong','beep', ... ]`
  agendaBootJobs: []
});

mongoose.configure({
  ...config.mongoose,
  logger,
  agenda
});

mongoose
  .connect()
  .then(() => {
    agenda.start();
  })
  .catch(logger.error);

const graceful = new Graceful({
  mongoose,
  agenda,
  logger
});

graceful.listen();

Contributors

NameWebsite
Nick Baughhttp://niftylettuce.com/

License

MIT © Nick Baugh

Keywords

FAQs

Last updated on 29 Aug 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc