Skip to content

Commit bb17c96

Browse files
committed
feat(mquery): remove function "Query.prototype._wrapCallback"
1 parent 7bbf4eb commit bb17c96

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

lib/mquery.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2587,39 +2587,6 @@ Query.prototype._findOneAndRemove = async function() {
25872587
return this._collection.findOneAndDelete(conds, options);
25882588
};
25892589

2590-
/**
2591-
* Wrap callback to add tracing
2592-
*
2593-
* @param {Function} callback
2594-
* @param {Object} [queryInfo]
2595-
* @api private
2596-
*/
2597-
Query.prototype._wrapCallback = function(method, callback, queryInfo) {
2598-
const traceFunction = this._traceFunction || Query.traceFunction;
2599-
2600-
if (traceFunction) {
2601-
queryInfo.collectionName = this._collection.collectionName;
2602-
2603-
const traceCallback = traceFunction &&
2604-
traceFunction.call(null, method, queryInfo, this);
2605-
2606-
const startTime = new Date().getTime();
2607-
2608-
return function wrapperCallback(err, result) {
2609-
if (traceCallback) {
2610-
const millis = new Date().getTime() - startTime;
2611-
traceCallback.call(null, err, result, millis);
2612-
}
2613-
2614-
if (callback) {
2615-
callback.apply(null, arguments);
2616-
}
2617-
};
2618-
}
2619-
2620-
return callback;
2621-
};
2622-
26232590
/**
26242591
* Add trace function that gets called when the query is executed.
26252592
* The function will be called with (method, queryInfo, query) and

0 commit comments

Comments
 (0)