[agenda] Add name config option (#45422)

* [agenda] Add `name` config option

* [agenda] add test for name config option

* [agenda] AgendaConfiguration.name is optional
This commit is contained in:
Dan Dascalescu 2020-07-12 12:49:44 +12:00 committed by GitHub
parent 103651e726
commit 7ca8470413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -6,6 +6,7 @@ var mongoConnectionString = "mongodb://127.0.0.1/agenda";
(async () => {
var agenda = new Agenda({ db: { address: mongoConnectionString } });
var agenda = new Agenda({
name: 'backend',
mongo: (await MongoClient.connect(mongoConnectionString)).db(),
db: { collection: 'agenda-jobs' },
});

View File

@ -165,6 +165,12 @@ declare namespace Agenda {
*/
interface AgendaConfiguration {
/**
* Sets the `lastModifiedBy` field to `name` in the jobs collection. Useful if you have multiple job processors
* (agendas) and want to see which job queue last ran the job.
*/
name?: string;
/**
* Sets the interval with which the queue is checked. A number in milliseconds or a frequency string.
*/