From 085a5a744064efbcd962265b46a8a74ad39051f7 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 12 Feb 2006 06:06:04 +0100 Subject: [PATCH] rename UPDATE_SCHEDULER to UPDATE_DAEMON, more update daemon work, update NEWS --- NEWS | 1 + backend.php | 30 ++++++++++++++---------------- config.php-dist | 6 +++--- tt-rss.php | 6 +++++- update_daemon.php | 8 ++++++-- 5 files changed, 29 insertions(+), 22 deletions(-) diff --git a/NEWS b/NEWS index e34adb28..2190b9e8 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ v1.1.3 (Feb xx, 2006) * Broken feed editor fixed * Compatibility layer for mb_* functions + * Experimental server-side update daemon for asynchronous operation v1.1.2 (Jan 20, 2006) diff --git a/backend.php b/backend.php index f103a5ab..f7dd6d17 100644 --- a/backend.php +++ b/backend.php @@ -703,7 +703,7 @@ if ($subop == "forceUpdateAllFeeds" || $subop == "updateAllFeeds") { - if (ENABLE_UPDATE_SCHEDULER) { + if (ENABLE_UPDATE_DAEMON) { $result = db_query($link, "SELECT count(id) AS cid FROM ttrss_scheduled_updates WHERE feed_id IS NULL AND @@ -731,22 +731,20 @@ update_all_feeds($link, $subop == "forceUpdateAllFeeds"); } - if (!(ENABLE_UPDATE_SCHEDULER && $subop == "forceUpdateAllFeeds")) { + $omode = $_GET["omode"]; - $omode = $_GET["omode"]; + if (!$omode) $omode = "tfl"; - if (!$omode) $omode = "tfl"; - - print ""; - if (strchr($omode, "l")) getLabelCounters($link); - if (strchr($omode, "f")) getFeedCounters($link); - if (strchr($omode, "t")) getTagCounters($link); - if (get_pref($link, 'ENABLE_FEED_CATS')) { - getCategoryCounters($link); - } - getGlobalCounters($link); - print ""; + print ""; + if (strchr($omode, "l")) getLabelCounters($link); + if (strchr($omode, "f")) getFeedCounters($link); + if (strchr($omode, "t")) getTagCounters($link); + if (get_pref($link, 'ENABLE_FEED_CATS')) { + getCategoryCounters($link); } + getGlobalCounters($link); + print ""; + } /* GET["cmode"] = 0 - mark as read, 1 - as unread, 2 - toggle */ @@ -1036,7 +1034,7 @@ if ($subop == "ForceUpdate" && sprintf("%d", $feed) > 0) { -/* if (ENABLE_UPDATE_SCHEDULER) { +/* if (ENABLE_UPDATE_DAEMON) { if ($cid == 0) { @@ -1052,7 +1050,7 @@ $tmp_result = db_query($link, "SELECT feed_url FROM ttrss_feeds WHERE id = '$feed'"); $feed_url = db_fetch_result($tmp_result, 0, "feed_url"); - update_rss_feed($link, $feed_url, $feed, ENABLE_UPDATE_SCHEDULER); + update_rss_feed($link, $feed_url, $feed, ENABLE_UPDATE_DAEMON); } if ($subop == "MarkAllRead") { diff --git a/config.php-dist b/config.php-dist index 7028ee01..eb7e2baa 100644 --- a/config.php-dist +++ b/config.php-dist @@ -87,12 +87,12 @@ // It is also recommended to set FEEDS_FRAME_REFRESH to a lower value if using // this option. - define('ENABLE_UPDATE_SCHEDULER', false); + define('ENABLE_UPDATE_DAEMON', false); // This enables different mechanism for user-triggered updates designed // for update daemon running in background on the server. - // This option _REQUIRES_ DAEMON_REFRESH_ONLY to be enabled and it is - // suggested to set FEEDS_FRAME_REFRESH to a small value (like 15-30 seconds). + // This option suggests FEEDS_FRAME_REFRESH set to a small value + // (like 10-15 seconds, depending on number of users and server/bandwidth load). // vim:ft=php ?> diff --git a/tt-rss.php b/tt-rss.php index 821c9b10..1245be27 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -110,7 +110,9 @@ @@ -218,8 +220,10 @@ + - + + diff --git a/update_daemon.php b/update_daemon.php index d9a465a5..37c42ba1 100644 --- a/update_daemon.php +++ b/update_daemon.php @@ -34,9 +34,13 @@ while (true) { - // FIXME: get all schedule updates w/forced refetch + // FIXME: get all scheduled updates w/forced refetch - print "Checking schedules updates (NOT IMPLEMENTED YET)\n"; +# $result = db_query($link, "SELECT * FROM ttrss_scheduled_updates ORDER BY id"); +# while ($line = db_fetch_assoc($result)) { +# print "Scheduled feed update: " . $line["feed_id"] . ", UID: " . +# $line["owner_uid"] . "\n"; +# } // Process all other feeds using last_updated and interval parameters -- 2.39.2