MessageReceiver: Ensure that we queue all cached first
FREEBIE
This commit is contained in:
parent
b4f6721846
commit
0b4d14e5ac
1 changed files with 2 additions and 4 deletions
|
@ -33,9 +33,7 @@ MessageReceiver.prototype.extend({
|
||||||
keepalive: { path: '/v1/keepalive', disconnect: true }
|
keepalive: { path: '/v1/keepalive', disconnect: true }
|
||||||
});
|
});
|
||||||
|
|
||||||
this.pending = Promise.resolve();
|
this.pending = this.queueAllCached();
|
||||||
|
|
||||||
this.queueAllCached();
|
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
this.socket.close(3000, 'called close');
|
this.socket.close(3000, 'called close');
|
||||||
|
@ -156,7 +154,7 @@ MessageReceiver.prototype.extend({
|
||||||
this.dispatchEvent(ev);
|
this.dispatchEvent(ev);
|
||||||
},
|
},
|
||||||
queueAllCached: function() {
|
queueAllCached: function() {
|
||||||
this.getAllFromCache().then(function(items) {
|
return this.getAllFromCache().then(function(items) {
|
||||||
for (var i = 0, max = items.length; i < max; i += 1) {
|
for (var i = 0, max = items.length; i < max; i += 1) {
|
||||||
this.queueCached(items[i]);
|
this.queueCached(items[i]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue