diff --git a/lib/utils.js b/lib/utils.js index 3def329a..2c1b5ffc 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -124,8 +124,8 @@ export function calculateWaitedOnTime (messageQueue, startedTime) { messageQueue.toArray().forEach(function (msg) { if (msg._waitEventId) { waitedOnTime += now - msg._waitEventId.at; - if(msg._waitEventId.at < startedTime) { - waitedOnTime -= startedTime - msg._waitEventId.at + if (msg._waitEventId.at < startedTime) { + waitedOnTime -= startedTime - msg._waitEventId.at; } } }); diff --git a/tests/models/methods.js b/tests/models/methods.js index c6173350..e86b2dd5 100644 --- a/tests/models/methods.js +++ b/tests/models/methods.js @@ -221,7 +221,7 @@ Tinytest.addAsync('Models - Method - Waited On - track waitedOn without wait tim console.log('slow method end'); }); let unblockedMethod = RegisterMethod(function () { - this.unblock() + this.unblock(); Meteor._sleepForMs(100); console.log('slow method end'); }); diff --git a/tests/models/pubsub.js b/tests/models/pubsub.js index 5466748c..54a0e6f7 100644 --- a/tests/models/pubsub.js +++ b/tests/models/pubsub.js @@ -780,7 +780,7 @@ Tinytest.addAsync('Models - PubSub - Waited On - track wait time of queued messa }); Meteor.publish('tinytest-unblock-fast', function () { - console.log('unblock-fast-pub') + console.log('unblock-fast-pub'); this.unblock(); Meteor._sleepForMs(100); this.ready();