daemon: cache parser object while processing a batch of feeds withsame url on first success
This commit is contained in:
parent
0f6b926393
commit
88edaa9344
|
@ -172,9 +172,11 @@
|
||||||
ORDER BY ttrss_feeds.id $query_limit");
|
ORDER BY ttrss_feeds.id $query_limit");
|
||||||
|
|
||||||
if (db_num_rows($tmp_result) > 0) {
|
if (db_num_rows($tmp_result) > 0) {
|
||||||
|
$rss = false;
|
||||||
|
|
||||||
while ($tline = db_fetch_assoc($tmp_result)) {
|
while ($tline = db_fetch_assoc($tmp_result)) {
|
||||||
if($debug) _debug(" => " . $tline["last_updated"] . ", " . $tline["id"] . " " . $tline["owner_uid"]);
|
if($debug) _debug(" => " . $tline["last_updated"] . ", " . $tline["id"] . " " . $tline["owner_uid"]);
|
||||||
update_rss_feed($tline["id"], true);
|
$rss = update_rss_feed($tline["id"], true, false, $rss);
|
||||||
_debug_suppress(false);
|
_debug_suppress(false);
|
||||||
++$nf;
|
++$nf;
|
||||||
}
|
}
|
||||||
|
@ -191,7 +193,7 @@
|
||||||
} // function update_daemon_common
|
} // function update_daemon_common
|
||||||
|
|
||||||
// ignore_daemon is not used
|
// ignore_daemon is not used
|
||||||
function update_rss_feed($feed, $ignore_daemon = false, $no_cache = false) {
|
function update_rss_feed($feed, $ignore_daemon = false, $no_cache = false, $rss = false) {
|
||||||
|
|
||||||
$debug_enabled = defined('DAEMON_EXTENDED_DEBUG') || $_REQUEST['xdebug'];
|
$debug_enabled = defined('DAEMON_EXTENDED_DEBUG') || $_REQUEST['xdebug'];
|
||||||
|
|
||||||
|
@ -252,7 +254,9 @@
|
||||||
$pluginhost->load($user_plugins, PluginHost::KIND_USER, $owner_uid);
|
$pluginhost->load($user_plugins, PluginHost::KIND_USER, $owner_uid);
|
||||||
$pluginhost->load_data();
|
$pluginhost->load_data();
|
||||||
|
|
||||||
$rss = false;
|
if ($rss && is_object($rss) && get_class($rss) == "FeedParser") {
|
||||||
|
_debug("using previously initialized parser object");
|
||||||
|
} else {
|
||||||
$rss_hash = false;
|
$rss_hash = false;
|
||||||
|
|
||||||
$force_refetch = isset($_REQUEST["force_refetch"]);
|
$force_refetch = isset($_REQUEST["force_refetch"]);
|
||||||
|
@ -273,6 +277,7 @@
|
||||||
} else {
|
} else {
|
||||||
_debug("local cache will not be used for this feed", $debug_enabled);
|
_debug("local cache will not be used for this feed", $debug_enabled);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$rss) {
|
if (!$rss) {
|
||||||
|
|
||||||
|
@ -1110,11 +1115,13 @@
|
||||||
db_query(
|
db_query(
|
||||||
"UPDATE ttrss_feeds SET last_error = '$error_msg',
|
"UPDATE ttrss_feeds SET last_error = '$error_msg',
|
||||||
last_updated = NOW() WHERE id = '$feed'");
|
last_updated = NOW() WHERE id = '$feed'");
|
||||||
}
|
|
||||||
|
|
||||||
unset($rss);
|
unset($rss);
|
||||||
|
}
|
||||||
|
|
||||||
_debug("done", $debug_enabled);
|
_debug("done", $debug_enabled);
|
||||||
|
|
||||||
|
return $rss;
|
||||||
}
|
}
|
||||||
|
|
||||||
function cache_images($html, $site_url, $debug) {
|
function cache_images($html, $site_url, $debug) {
|
||||||
|
|
Loading…
Reference in New Issue