Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Commit

Permalink
More fixes to the persistence sequence.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Sep 8, 2013
1 parent d5178e9 commit f726ad1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Client.prototype.unsubscribeMapTo = function(topic) {
*/
Client.prototype.unsubAndClose = function(cb) {
var that = this;
this.server.persistClient(this);
this._closing = true;
async.parallel(Object.keys(that.subscriptions).map(that.unsubscribeMapTo.bind(that)), function() {
that.close(cb);
});
Expand Down Expand Up @@ -491,6 +491,7 @@ Client.prototype.close = function(callback) {
if (this._closed) {
cleanup();
} else {
this.server.persistClient(this);
this.connection.stream.on("end", cleanup);
this.connection.stream.end();
}
Expand Down

0 comments on commit f726ad1

Please sign in to comment.