]> git.wh0rd.org - tt-rss.git/commitdiff
new option: SYNC_COUNTERS (bump schema)
authorAndrew Dolgov <fox@bah.spb.su>
Wed, 23 Jul 2008 03:55:35 +0000 (04:55 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Wed, 23 Jul 2008 03:55:35 +0000 (04:55 +0100)
backend.php
feedlist.js
functions.php
localized_schema.php
sanity_check.php
schema/ttrss_schema_mysql.sql
schema/ttrss_schema_pgsql.sql
schema/versions/mysql/38.sql [new file with mode: 0644]
schema/versions/pgsql/38.sql [new file with mode: 0644]

index a73e54078cd0cb46ad6665574e455b639ee2dea5..cc5fd46c665b05dbeabb991b8060a39dfab866d2 100644 (file)
                                }
                        }
 
-                       if ($mode == "prefetch" && $csync) {
+
+                       if (get_pref($link, "SYNC_COUNTERS") || ($mode == "prefetch" && $csync)) {
                                print "<counters>";
                                getAllCounters($link, $omode);
                                print "</counters>";
                                $viewfeed_ctr_interval = 60;
                        }
 
-                       if (time() - $_SESSION["get_all_counters_stamp"] > $viewfeed_ctr_interval) {
+                       if (get_pref($link, "SYNC_COUNTERS") ||                         
+                                       time() - $_SESSION["get_all_counters_stamp"] > $viewfeed_ctr_interval) {
                                print "<counters>";
                                getAllCounters($link, $omode, $feed);
                                print "</counters>";
index 5ae6044937a0cb392d882063b0b2bb282c10403d..1f851e0e8156d19b410eb412c0d25bee7937334e 100644 (file)
@@ -542,7 +542,11 @@ function request_counters() {
                var date = new Date();
                var timestamp = Math.round(date.getTime() / 1000);
 
+//             if (getInitParam("sync_counters") == "1" || 
+//                             timestamp - counters_last_request > 10) {
+
                if (timestamp - counters_last_request > 10) {
+
                        debug("scheduling request of counters...");
                        window.setTimeout("request_counters_real()", 1000);
                        counters_last_request = timestamp;
index 04ddaadbbdf7c79155feafb1127a53f6801e6531..5a72f681f0ce7d28fad1dadaeb900b521cbc4f6b 100644 (file)
                /* getting all counters is a resource intensive operation, so we
                 * rate limit it a little bit */
 
-               if (time() - $_SESSION["get_all_counters_stamp"] > 5) {
+
+
+               if (get_pref($link, "SYNC_COUNTERS") || 
+                               time() - $_SESSION["get_all_counters_stamp"] > 5) {
 
                        if (!$omode) $omode = "flc";
        
                print "<param key=\"bw_limit\" value=\"".
                        (int) $_SESSION["bw_limit"]."\"/>";
 
+               print "<param key=\"sync_counters\" value=\"" . 
+                       (int) get_pref($link, "SYNC_COUNTERS") . "\"/>";
+
                print "</init-params>";
        }
 
index 083e2eb24bfe70ee6dea2f6a1e9f11e5dd49e29e..9325160dff410f5355fbc07f12ffef294483be0a 100644 (file)
@@ -72,5 +72,6 @@
        __("Automatically expand articles in combined mode");
        __("Purge unread articles");
        __("Show special feeds when hiding read feeds");
+       __("Prefer more accurate feedlist counters to UI speed");
 
 ?>
index 383edab4cb4eb8bfa83aaf75fd380565e7b27bce..ee715a8234352d6cb3e5dce12e9db835f7a35807 100644 (file)
@@ -2,7 +2,7 @@
        require_once "functions.php";
 
        define('EXPECTED_CONFIG_VERSION', 17);
-       define('SCHEMA_VERSION', 37);
+       define('SCHEMA_VERSION', 38);
 
        if (!file_exists("config.php")) {
                print __("<b>Fatal Error</b>: You forgot to copy 
index d3082da01f0304e47b673ac85f5f9cd2e74a0a8f..59a8c83b5c31229e82bef3afc431dc02165f90fb 100644 (file)
@@ -209,7 +209,7 @@ create table ttrss_tags (id integer primary key auto_increment,
 
 create table ttrss_version (schema_version int not null) TYPE=InnoDB;
 
-insert into ttrss_version values (37);
+insert into ttrss_version values (38);
 
 create table ttrss_enclosures (id serial not null primary key,
        content_url text not null,
@@ -332,6 +332,8 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('VFEED_GROUP_BY_FEED', 1, 'false', 'Group headlines in virtual feeds',2,
        'When this option is enabled, headlines in Special feeds and Labels are grouped by feeds');
 
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('SYNC_COUNTERS', 1, 'false', 'Prefer more accurate feedlist counters to UI speed',3);
+
 create table ttrss_user_prefs (
    owner_uid integer not null,
    pref_name varchar(250),
index 6d70ddc6fd1bba73b2f9f61712dc39a41583d2c8..c0cddfbadcff84cb5f1ff64a48acef0b2b2d9545 100644 (file)
@@ -189,7 +189,7 @@ create index ttrss_tags_owner_uid_index on ttrss_tags(owner_uid);
 
 create table ttrss_version (schema_version int not null);
 
-insert into ttrss_version values (37);
+insert into ttrss_version values (38);
 
 create table ttrss_enclosures (id serial not null primary key,
        content_url text not null,
@@ -306,6 +306,8 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('VFEED_GROUP_BY_FEED', 1, 'false', 'Group headlines in virtual feeds',2,
        'When this option is enabled, headlines in Special feeds and Labels are grouped by feeds');
 
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('SYNC_COUNTERS', 1, 'false', 'Prefer more accurate feedlist counters to UI speed',3);
+
 create table ttrss_user_prefs (
        owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
        pref_name varchar(250) not null references ttrss_prefs(pref_name) ON DELETE CASCADE,
diff --git a/schema/versions/mysql/38.sql b/schema/versions/mysql/38.sql
new file mode 100644 (file)
index 0000000..df544d0
--- /dev/null
@@ -0,0 +1,3 @@
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('SYNC_COUNTERS', 1, 'false', 'Prefer more accurate feedlist counters to UI speed',3);
+
+update ttrss_version set schema_version = 38;
diff --git a/schema/versions/pgsql/38.sql b/schema/versions/pgsql/38.sql
new file mode 100644 (file)
index 0000000..df544d0
--- /dev/null
@@ -0,0 +1,3 @@
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('SYNC_COUNTERS', 1, 'false', 'Prefer more accurate feedlist counters to UI speed',3);
+
+update ttrss_version set schema_version = 38;