1
- import humanInterval from "human-interval" ;
2
1
import { EventEmitter } from "events" ;
2
+ import humanInterval from "human-interval" ;
3
3
import {
4
- MongoClient ,
5
- Db as MongoDb ,
4
+ AnyError ,
6
5
Collection ,
6
+ Db as MongoDb ,
7
+ MongoClient ,
7
8
MongoClientOptions ,
8
- AnyError ,
9
9
} from "mongodb" ;
10
- import { JobProcessingQueue } from "./job-processing-queue " ;
10
+ import { Job } from ".. /job" ;
11
11
import { cancel } from "./cancel" ;
12
12
import { close } from "./close" ;
13
13
import { create } from "./create" ;
@@ -20,6 +20,8 @@ import { define } from "./define";
20
20
import { disable } from "./disable" ;
21
21
import { enable } from "./enable" ;
22
22
import { every } from "./every" ;
23
+ import { findAndLockNextJob } from "./find-and-lock-next-job" ;
24
+ import { JobProcessingQueue } from "./job-processing-queue" ;
23
25
import { jobs } from "./jobs" ;
24
26
import { lockLimit } from "./lock-limit" ;
25
27
import { maxConcurrency } from "./max-concurrency" ;
@@ -33,8 +35,6 @@ import { schedule } from "./schedule";
33
35
import { sort } from "./sort" ;
34
36
import { start } from "./start" ;
35
37
import { stop } from "./stop" ;
36
- import { findAndLockNextJob } from "./find-and-lock-next-job" ;
37
- import { Job } from "../job" ;
38
38
39
39
export interface AgendaConfig {
40
40
name ?: string ;
@@ -79,7 +79,7 @@ class Agenda extends EventEmitter {
79
79
_defaultLockLifetime : any ;
80
80
_defaultLockLimit : any ;
81
81
_definitions : any ;
82
- _findAndLockNextJob : any ;
82
+ _findAndLockNextJob = findAndLockNextJob ;
83
83
_indices : any ;
84
84
_isLockingOnTheFly : boolean ;
85
85
_isJobQueueFilling : Map < string , boolean > ;
@@ -192,7 +192,6 @@ class Agenda extends EventEmitter {
192
192
}
193
193
}
194
194
195
- Agenda . prototype . _findAndLockNextJob = findAndLockNextJob ;
196
195
Agenda . prototype . cancel = cancel ;
197
196
Agenda . prototype . close = close ;
198
197
Agenda . prototype . create = create ;
0 commit comments