1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-15 10:46:49 +00:00

fix updating for pgsql

increase default batch size
remove random check between feedbrowser or update task executing
This commit is contained in:
Andrew Dolgov
2013-04-24 13:43:40 +04:00
parent 81c2066345
commit fce451a4f7
2 changed files with 15 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
<?php <?php
define('DAEMON_UPDATE_LOGIN_LIMIT', 30); define_default('DAEMON_UPDATE_LOGIN_LIMIT', 30);
define('DAEMON_FEED_LIMIT', 100); define_default('DAEMON_FEED_LIMIT', 500);
define('DAEMON_SLEEP_INTERVAL', 60); define_default('DAEMON_SLEEP_INTERVAL', 60);
function update_feedbrowser_cache() { function update_feedbrowser_cache() {
@@ -113,8 +113,7 @@
$query_limit = ""; $query_limit = "";
if($limit) $query_limit = sprintf("LIMIT %d", $limit); if($limit) $query_limit = sprintf("LIMIT %d", $limit);
// We search for feed needing update. $query = "SELECT DISTINCT ttrss_feeds.feed_url, ttrss_feeds.last_updated
$result = db_query("SELECT DISTINCT ttrss_feeds.feed_url
FROM FROM
ttrss_feeds, ttrss_users, ttrss_user_prefs ttrss_feeds, ttrss_users, ttrss_user_prefs
WHERE WHERE
@@ -123,7 +122,10 @@
AND ttrss_user_prefs.pref_name = 'DEFAULT_UPDATE_INTERVAL' AND ttrss_user_prefs.pref_name = 'DEFAULT_UPDATE_INTERVAL'
$login_thresh_qpart $update_limit_qpart $login_thresh_qpart $update_limit_qpart
$updstart_thresh_qpart $updstart_thresh_qpart
ORDER BY last_updated $query_limit"); ORDER BY last_updated $query_limit";
// We search for feed needing update.
$result = db_query($query);
if($debug) _debug(sprintf("Scheduled %d feeds to update...", db_num_rows($result))); if($debug) _debug(sprintf("Scheduled %d feeds to update...", db_num_rows($result)));

View File

@@ -184,24 +184,17 @@
_debug("warning: unable to create stampfile\n"); _debug("warning: unable to create stampfile\n");
} }
// Call to the feed batch update function update_daemon_common();
// or regenerate feedbrowser cache
if (rand(0,100) > 30) { $count = update_feedbrowser_cache();
update_daemon_common(); _debug("Feedbrowser updated, $count feeds processed.");
} else {
$count = update_feedbrowser_cache();
_debug("Feedbrowser updated, $count feeds processed.");
purge_orphans( true); purge_orphans( true);
$rc = cleanup_tags( 14, 50000); $rc = cleanup_tags( 14, 50000);
_debug("Cleaned $rc cached tags.");
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_UPDATE_TASK, "hook_update_task", $op);
}
_debug("Cleaned $rc cached tags.");
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_UPDATE_TASK, "hook_update_task", $op);
} }
if (isset($options["cleanup-tags"])) { if (isset($options["cleanup-tags"])) {