mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Space out code for readability.
This commit is contained in:
committed by
Nick Martin
parent
f80e7b56d4
commit
b2bb2c0dab
@@ -384,26 +384,31 @@ _.extend(Session.prototype, {
|
||||
// down. If a socket was attached, close it.
|
||||
destroy: function () {
|
||||
var self = this;
|
||||
|
||||
if (self.socket) {
|
||||
self.socket.close();
|
||||
self.socket._meteorSession = null;
|
||||
}
|
||||
|
||||
// Drop the merge box data immediately.
|
||||
self.collectionViews = {};
|
||||
self.inQueue = null;
|
||||
|
||||
Package.facts && Package.facts.Facts.incrementServerFact(
|
||||
"livedata", "sessions", -1);
|
||||
|
||||
Meteor.defer(function () {
|
||||
// stop callbacks can yield, so we defer this on destroy.
|
||||
// sub._isDeactivated() detects that we set inQueue to null and
|
||||
// treats it as semi-deactivated (it will ignore incoming callbacks, etc).
|
||||
self._deactivateAllSubscriptions();
|
||||
});
|
||||
// Drop the merge box data immediately.
|
||||
self.collectionViews = {};
|
||||
self.inQueue = null;
|
||||
Meteor.defer(function () {
|
||||
|
||||
// Defer calling the close callbacks, so that the caller closing
|
||||
// the session isn't waiting for all the callbacks to complete.
|
||||
_.each(self._closeCallbacks, function (callback) {
|
||||
callback();
|
||||
});
|
||||
});
|
||||
Package.facts && Package.facts.Facts.incrementServerFact(
|
||||
"livedata", "sessions", -1);
|
||||
},
|
||||
|
||||
// Send a message (doing nothing if no socket is connected right now.)
|
||||
|
||||
Reference in New Issue
Block a user