File tree 3 files changed +13
-4
lines changed
3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @hokify/agenda" ,
3
- "version" : " 4.0.5 " ,
3
+ "version" : " 4.0.6 " ,
4
4
"description" : " Light weight job scheduler for Node.js" ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -147,7 +147,11 @@ export class JobDbRepository {
147
147
148
148
this . collection = db . collection ( collection ) ;
149
149
log (
150
- `connected with collection: ${ collection } , collection size: ${ await this . collection . estimatedDocumentCount ( ) } `
150
+ `connected with collection: ${ collection } , collection size: ${
151
+ typeof this . collection . estimatedDocumentCount === 'function'
152
+ ? await this . collection . estimatedDocumentCount ( )
153
+ : '?'
154
+ } `
151
155
) ;
152
156
153
157
if ( this . connectOptions . ensureIndex ) {
@@ -183,7 +187,12 @@ export class JobDbRepository {
183
187
reconnectTries : Number . MAX_SAFE_INTEGER
184
188
} ;
185
189
186
- const client = await MongoClient . connect ( url , { ...reconnectOptions , ...options } ) ;
190
+ const client = await MongoClient . connect ( url , {
191
+ ...reconnectOptions ,
192
+ ...options ,
193
+ useNewUrlParser : true ,
194
+ useUnifiedTopology : true
195
+ } ) ;
187
196
188
197
return client . db ( ) ;
189
198
}
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export class Agenda extends EventEmitter {
47
47
48
48
private jobProcessor ?: JobProcessor ;
49
49
50
- private ready : Promise < unknown > ;
50
+ private ready : Promise < void > ;
51
51
52
52
getRunningStats ( ) {
53
53
if ( ! this . jobProcessor ) {
You can’t perform that action at this time.
0 commit comments