mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
remove bindEnvironment from code hotspots
This commit is contained in:
@@ -133,10 +133,7 @@ Object.assign(AsynchronousQueue.prototype, {
|
||||
);
|
||||
|
||||
const handle = {
|
||||
task: Meteor.bindEnvironment(task, function (e) {
|
||||
Meteor._debug('Exception from task', e);
|
||||
throw e;
|
||||
}),
|
||||
task,
|
||||
name: task.name,
|
||||
resolver,
|
||||
};
|
||||
|
||||
@@ -338,10 +338,6 @@ var writeCallback = function (write, refresh, callback) {
|
||||
};
|
||||
};
|
||||
|
||||
var bindEnvironmentForWrite = function (callback) {
|
||||
return Meteor.bindEnvironment(callback, "Mongo write");
|
||||
};
|
||||
|
||||
MongoConnection.prototype.insertAsync = async function (collection_name, document) {
|
||||
const self = this;
|
||||
|
||||
@@ -967,24 +963,8 @@ Cursor.prototype.observeAsync = function (callbacks) {
|
||||
|
||||
Cursor.prototype.observeChanges = function (callbacks, options = {}) {
|
||||
var self = this;
|
||||
var methods = [
|
||||
'addedAt',
|
||||
'added',
|
||||
'changedAt',
|
||||
'changed',
|
||||
'removedAt',
|
||||
'removed',
|
||||
'movedTo'
|
||||
];
|
||||
var ordered = LocalCollection._observeChangesCallbacksAreOrdered(callbacks);
|
||||
|
||||
let exceptionName = callbacks._fromObserve ? 'observe' : 'observeChanges';
|
||||
exceptionName += ' callback';
|
||||
methods.forEach(function (method) {
|
||||
if (callbacks[method] && typeof callbacks[method] == "function") {
|
||||
callbacks[method] = Meteor.bindEnvironment(callbacks[method], method + exceptionName);
|
||||
}
|
||||
});
|
||||
var ordered = LocalCollection._observeChangesCallbacksAreOrdered(callbacks);
|
||||
|
||||
return self._mongo._observeChanges(
|
||||
self._cursorDescription, ordered, callbacks, options.nonMutatingCallbacks);
|
||||
|
||||
Reference in New Issue
Block a user