]> git.wh0rd.org Git - tt-rss.git/commitdiff
adjust rate limits on automatic update of offline info
authorAndrew Dolgov <fox@bah.org.ru>
Tue, 3 Feb 2009 19:40:27 +0000 (22:40 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Tue, 3 Feb 2009 19:40:27 +0000 (22:40 +0300)
feedlist.js
modules/backend-rpc.php
tt-rss.js

index d61ebfc235a99d881ae13ea068d872b079bb29c4..48369089f38c90d250c52f008174ed8f35ed61d3 100644 (file)
@@ -1019,9 +1019,7 @@ function update_feedlist_counters() {
 
                hideOrShowFeeds(getInitParam("hide_read_feeds") == 1);
 
-               var unread = get_local_feed_unread(-4);
-
-               global_unread = unread;
+               global_unread = get_local_feed_unread(-4);
                updateTitle();
 
        } catch (e) {
index 967e97aea349693209571658b1e6cc1654c0adc9..3042703caa05f2f94ac3679457fe3c579686d986 100644 (file)
                        //$unread_only = db_escape_string($_REQUEST["unread_only"]);
                        //if (!$amount) $amount = 50;
 
-                       $amount = 100;
+                       $amount = 200;
                        $unread_only = true;
 
                        print "<rpc-reply>";
                                                $line["unread"] = (int)sql_bool_to_bool($line["unread"]);
                                                $line["tags"] = format_tags_string(get_article_tags($link, $id), $id);
 
-
                                                print json_encode($line);
                                                print "]]></article>";
                                        }
index b4f2d2adb2d5b87f72c9e0177531d906b05b7f68..0182e8e5bc1e7c6049adb17fce4ba6e5c8c7a3da 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -242,6 +242,8 @@ function updateFeedList(silent, fetch) {
 
        debug("<b>updateFeedList</b>");
 
+       if (offline_mode) return render_offline_feedlist();
+
        var query_str = "backend.php?op=feeds";
 
        if (display_tags) {
@@ -1582,7 +1584,7 @@ function offline_download_parse(stage, transport) {
                                                [id, title, has_icon]);
                                }
                
-                               window.setTimeout("update_offline_data("+(stage+1)+")", 50);
+                               window.setTimeout("update_offline_data("+(stage+1)+")", 30*1000);
                        } else {
 
                                var articles = transport.responseXML.getElementsByTagName("article");
@@ -1609,10 +1611,9 @@ function offline_download_parse(stage, transport) {
                                }
 
                                if (articles_found > 0) {
-                                       window.setTimeout("update_offline_data("+(stage+1)+")", 50);
+                                       window.setTimeout("update_offline_data("+(stage+1)+")", 60*1000);
                                } else {
-//                                     notify_info("All done.");
-//                                     closeInfoBox();
+                                       window.setTimeout("update_offline_data(0)", 1800*1000);
                                }
                        }
 
@@ -1647,6 +1648,7 @@ function update_offline_data(stage) {
                new Ajax.Request(query, {
                        onComplete: function(transport) { 
                                offline_download_parse(stage, transport);                               
+                               debug("update_offline_data: done " + stage);
                        } });
 
        } catch (e) {