mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Adds the agenda property to Job.
This commit is contained in:
parent
93d659fc39
commit
2ce5a2ef2d
@ -3,16 +3,16 @@ import * as Agenda from "agenda";
|
||||
var mongoConnectionString = "mongodb://127.0.0.1/agenda";
|
||||
|
||||
var agenda = new Agenda({ db: { address: mongoConnectionString } });
|
||||
|
||||
|
||||
|
||||
|
||||
agenda.define('delete old users', (job, done) => {
|
||||
|
||||
});
|
||||
|
||||
agenda.on('ready', () => {
|
||||
agenda.every('3 minutes', 'delete old users');
|
||||
|
||||
// Alternatively, you could also do:
|
||||
|
||||
// Alternatively, you could also do:
|
||||
agenda.every('*/3 * * * *', 'delete old users');
|
||||
|
||||
agenda.start();
|
||||
@ -81,6 +81,8 @@ agenda.stop(function() {
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
job.agenda.now('do the hokey pokey');
|
||||
|
||||
job.repeatEvery('10 minutes');
|
||||
|
||||
job.repeatAt('3:30pm');
|
||||
|
||||
7
types/agenda/index.d.ts
vendored
7
types/agenda/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// Type definitions for Agenda v0.8.9
|
||||
// Type definitions for Agenda v1.0.0
|
||||
// Project: https://github.com/rschmukler/agenda
|
||||
// Definitions by: Meir Gottlieb <https://github.com/meirgottlieb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@ -337,6 +337,11 @@ declare namespace Agenda {
|
||||
*/
|
||||
attrs: JobAttributes;
|
||||
|
||||
/**
|
||||
* The agenda that created the job.
|
||||
*/
|
||||
agenda: Agenda;
|
||||
|
||||
/**
|
||||
* Specifies an interval on which the job should repeat.
|
||||
* @param interval A human-readable format String, a cron format String, or a Number.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user