mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 08:32:39 +03:00
channel.js: ack every 30 events *even if this.outstandingJSON is empty*
This commit is contained in:
parent
85435e9a81
commit
5dd29f1fe7
@ -182,9 +182,6 @@ class Channel {
|
||||
// sends a JSON command command to the server.
|
||||
//
|
||||
sendJSONToChannel(j) {
|
||||
if(!j && this.outstandingJSON.length === 0) {
|
||||
return;
|
||||
}
|
||||
let req = new XMLHttpRequest();
|
||||
req.open("PUT", this.channelURL());
|
||||
req.setRequestHeader("Content-Type", "application/json");
|
||||
@ -193,8 +190,11 @@ class Channel {
|
||||
if (j) {
|
||||
this.outstandingJSON.push(j);
|
||||
}
|
||||
|
||||
if (this.outstandingJSON.length > 0) {
|
||||
let x = JSON.stringify(this.outstandingJSON);
|
||||
req.send(x);
|
||||
}
|
||||
} else {
|
||||
// we add an acknowledgment to clear the server side queue
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user