diff options
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | backend.php | 30 | ||||
-rw-r--r-- | config.php-dist | 6 | ||||
-rw-r--r-- | tt-rss.php | 6 | ||||
-rw-r--r-- | update_daemon.php | 8 |
5 files changed, 29 insertions, 22 deletions
@@ -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 f103a5abe..f7dd6d178 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 "<rpc-reply>"; - 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 "</rpc-reply>"; + print "<rpc-reply>"; + 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 "</rpc-reply>"; + } /* 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 7028ee01c..eb7e2baa0 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 821c9b107..1245be274 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -110,7 +110,9 @@ <select id="allFeedsChooser" onchange="allFeedsMenuChange()"> <option selected>All feeds...</option> + <? if (!ENABLE_UPDATE_DAEMON) { ?> <option>Update</option> + <? } ?> <option>Mark as read</option> <option>Show only unread</option> </select> @@ -218,8 +220,10 @@ <!-- <option>Edit this feed</option> --> <option disabled>--------</option> <option style="color : #5050aa" disabled>All feeds:</option> + <? if (!ENABLE_UPDATE_DAEMON) { ?> <option id="qmcUpdateFeeds"> Update</option> - <option id="qmcCatchupAll"> Mark as read</option> + <? } ?> + <option id="qmcCatchupAll"> Mark as read</option> <option id="qmcShowOnlyUnread"> Show only unread</option> <option disabled>--------</option> <option style="color : #5050aa" disabled>Other actions:</option> diff --git a/update_daemon.php b/update_daemon.php index d9a465a5e..37c42ba1b 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 |