Skip to content

Commit

Permalink
fix(define): warning if job definition exists already
Browse files Browse the repository at this point in the history
  • Loading branch information
simllll committed Oct 20, 2020
1 parent c2ca928 commit 3fe9a6d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ export class Agenda extends EventEmitter {
priority?: JobPriority;
}
): void {
if (this.definitions[name]) {
console.warn('overwriting already defined agenda job', name);
}
this.definitions[name] = {
fn: processor,
concurrency: options?.concurrency || this.attrs.defaultConcurrency,
Expand Down

0 comments on commit 3fe9a6d

Please sign in to comment.