Skip to content

Commit

Permalink
fix(query): maxTimeMS in count, countDocuments, distinct
Browse files Browse the repository at this point in the history
  • Loading branch information
FlameFractal committed Nov 15, 2020
1 parent 222a69f commit ffb4208
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -2217,6 +2217,8 @@ Query.prototype._count = wrapThunk(function(callback) {
return callback(this.error());
}

applyGlobalMaxTimeMS(this.options, this.model);

const conds = this._conditions;
const options = this._optionsForExec();

Expand All @@ -2242,6 +2244,8 @@ Query.prototype._countDocuments = wrapThunk(function(callback) {
return callback(this.error());
}

applyGlobalMaxTimeMS(this.options, this.model);

const conds = this._conditions;
const options = this._optionsForExec();

Expand Down Expand Up @@ -2447,6 +2451,8 @@ Query.prototype.__distinct = wrapThunk(function __distinct(callback) {
return null;
}

applyGlobalMaxTimeMS(this.options, this.model);

const options = this._optionsForExec();

// don't pass in the conditions because we already merged them in
Expand Down

0 comments on commit ffb4208

Please sign in to comment.