1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 02:35:54 +00:00

requestCounters: remove cooldown

This commit is contained in:
Andrew Dolgov
2018-12-12 20:06:44 +03:00
parent 5807f2e0f0
commit d53cdaf815
4 changed files with 10 additions and 34 deletions

View File

@@ -120,27 +120,10 @@ define(["dojo/_base/declare"], function (declare) {
this._search_query = "";
this.reloadCurrent();
},
requestCounters: function(force) {
const date = new Date();
const timestamp = Math.round(date.getTime() / 1000);
if (force || timestamp - this.counters_last_request > 5) {
console.log("scheduling request of counters...");
this.counters_last_request = timestamp;
let query = {op: "rpc", method: "getAllCounters", seq: App.next_seq()};
if (!force)
query.last_article_id = App.getInitParam("last_article_id");
xhrPost("backend.php", query, (transport) => {
App.handleRpcJson(transport);
});
} else {
console.log("request_counters: rate limit reached: " + (timestamp - this.counters_last_request));
}
requestCounters: function() {
xhrPost("backend.php", {op: "rpc", method: "getAllCounters", seq: App.next_seq()}, (transport) => {
App.handleRpcJson(transport);
});
},
reload: function() {
try {