]> git.wh0rd.org Git - tt-rss.git/commitdiff
daemon: do not schedule user-disabled feeds (2)
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 31 Mar 2013 10:36:06 +0000 (14:36 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 31 Mar 2013 10:36:06 +0000 (14:36 +0400)
include/rssfuncs.php
update_daemon2.php

index 36a4ced256a680aed169cf8768d3832c37440824..3bce14d33ab8786bd3b67bb8b7aa6a0a94fbbef8 100644 (file)
@@ -77,7 +77,7 @@
                if (DB_TYPE == "pgsql") {
                        $update_limit_qpart = "AND ((
                                        ttrss_feeds.update_interval = 0
-                                       AND CAST(ttrss_user_prefs.value AS INTEGER) != -1
+                                       AND ttrss_user_prefs.value != '-1'
                                        AND ttrss_feeds.last_updated < NOW() - CAST((ttrss_user_prefs.value || ' minutes') AS INTERVAL)
                                ) OR (
                                        ttrss_feeds.update_interval > 0
@@ -87,7 +87,7 @@
                } else {
                        $update_limit_qpart = "AND ((
                                        ttrss_feeds.update_interval = 0
-                                       AND CONVERT(ttrss_user_prefs.value, SIGNED INTEGER) != -1
+                                       AND ttrss_user_prefs.value != '-1'
                                        AND ttrss_feeds.last_updated < DATE_SUB(NOW(), INTERVAL CONVERT(ttrss_user_prefs.value, SIGNED INTEGER) MINUTE)
                                ) OR (
                                        ttrss_feeds.update_interval > 0
                        // since we have the data cached, we can deal with other feeds with the same url
 
                        $tmp_result = db_query($link, "SELECT ttrss_feeds.feed_url,ttrss_feeds.id,last_updated
-                       FROM ttrss_feeds, ttrss_users WHERE
-                               ttrss_users.id = ttrss_feeds.owner_uid AND
+                       FROM ttrss_feeds, ttrss_users, ttrss_user_prefs WHERE
+                               ttrss_user_prefs.owner_uid = ttrss_feeds.owner_uid AND
+                               ttrss_users.id = ttrss_user_prefs.owner_uid AND
+                               ttrss_user_prefs.pref_name = 'DEFAULT_UPDATE_INTERVAL' AND
                                feed_url = '".db_escape_string($link, $feed)."' AND
-                               ttrss_feeds.update_interval != -1
+                               (ttrss_feeds.update_interval > 0 OR
+                                       ttrss_user_prefs.value != '-1')
                                $login_thresh_qpart
                        ORDER BY feed_url $query_limit");
 
index 450b9339dc14784e0e49ae381241b7de0c7995b3..e8523d22bd99c7a82f189812a1c86c265f0f0a4e 100755 (executable)
                                        $nf = 0;
 
                                        _debug("Waiting before update..");
-                                       sleep(rand(5,15));
+                                       sleep(rand(1,15));
                                        $nf = update_daemon_common($link);
 
                                        if (rand(0,100) > 50) {