summaryrefslogtreecommitdiff
path: root/tt-rss.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-03-02 18:07:46 +0100
committerAndrew Dolgov <[email protected]>2006-03-02 18:07:46 +0100
commitc441662f982c4c44be5b8a6d75c5b0cdb29905bf (patch)
tree0df68e2a1af2d4353651e5b18a480a93397f04b2 /tt-rss.js
parentf26ef034b52faf09001db56d5be616dcea07c4db (diff)
xmlhttp sometimes get stuck in main loop: workaround
Diffstat (limited to 'tt-rss.js')
-rw-r--r--tt-rss.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/tt-rss.js b/tt-rss.js
index a600c9c33..aa08b74f7 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -8,6 +8,7 @@ var current_subtitle = "";
var daemon_enabled = false;
var _qfd_deleted_feed = 0;
var firsttime_update = true;
+var last_refetch = 0;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
@@ -102,6 +103,10 @@ function refetch_callback() {
if (xmlhttp.readyState == 4) {
try {
+ var date = new Date();
+
+ last_refetch = date.getTime() / 1000;
+
if (!xmlhttp.responseXML) {
notify("refetch_callback: backend did not return valid XML");
return;
@@ -207,11 +212,19 @@ function scheduleFeedUpdate(force) {
debug("in scheduleFeedUpdate");
+ var date = new Date();
+
+ if (!xmlhttp_ready(xmlhttp) && last_refetch < date.getTime() / 1000 - 60) {
+ debug("xmlhttp seems to be stuck, aborting");
+ xmlhttp.abort();
+ }
+
if (xmlhttp_ready(xmlhttp)) {
xmlhttp.open("GET", query_str, true);
xmlhttp.onreadystatechange=refetch_callback;
xmlhttp.send(null);
} else {
+ debug("xmlhttp busy");
printLockingError();
}
}