updaterandomfeed: use max_execution_time parameter

This commit is contained in:
Andrew Dolgov 2013-01-22 20:07:34 +04:00
parent 8b83bf5fa1
commit 6b1a4ecd41
4 changed files with 9 additions and 4 deletions

View File

@ -699,7 +699,7 @@ class RPC extends Handler_Protected {
while ($line = db_fetch_assoc($result)) { while ($line = db_fetch_assoc($result)) {
$feed_id = $line["id"]; $feed_id = $line["id"];
if (time() - $tstart < 30) { if (time() - $tstart < ini_get("max_execution_time") * 0.7) {
update_rss_feed($this->link, $feed_id, true); update_rss_feed($this->link, $feed_id, true);
++$num_updated; ++$num_updated;
} else { } else {

View File

@ -28,6 +28,11 @@
// Operate in single user mode, disables all functionality related to // Operate in single user mode, disables all functionality related to
// multiple users. // multiple users.
define('SIMPLE_UPDATE_MODE', false);
// Enables fallback update mode where tt-rss tries to update feeds in
// background while tt-rss is open in your browser. Not recommended, please
// read http://tt-rss.org/wiki/UpdatingFeeds for more information.
// ***************************** // *****************************
// *** Files and directories *** // *** Files and directories ***
// ***************************** // *****************************

View File

@ -1968,7 +1968,7 @@
$params["csrf_token"] = $_SESSION["csrf_token"]; $params["csrf_token"] = $_SESSION["csrf_token"];
$params["widescreen"] = (int) $_SESSION["widescreen"]; $params["widescreen"] = (int) $_SESSION["widescreen"];
$params['simple_update'] = defined('_SIMPLE_UPDATE_MODE') && _SIMPLE_UPDATE_MODE; $params['simple_update'] = defined('SIMPLE_UPDATE_MODE') && SIMPLE_UPDATE_MODE;
return $params; return $params;
} }

View File

@ -1,3 +1,3 @@
<?php # This file has been generated at: Thu Dec 27 15:13:04 MSK 2012 <?php # This file has been generated at: Tue Jan 22 20:00:53 MSK 2013
define('GENERATED_CONFIG_CHECK', 26); define('GENERATED_CONFIG_CHECK', 26);
$requred_defines = array( 'DB_TYPE', 'DB_HOST', 'DB_USER', 'DB_NAME', 'DB_PASS', 'MYSQL_CHARSET', 'SELF_URL_PATH', 'SINGLE_USER_MODE', 'PHP_EXECUTABLE', 'LOCK_DIRECTORY', 'CACHE_DIR', 'ICONS_DIR', 'ICONS_URL', 'AUTH_AUTO_CREATE', 'AUTH_AUTO_LOGIN', 'FORCE_ARTICLE_PURGE', 'PUBSUBHUBBUB_HUB', 'PUBSUBHUBBUB_ENABLED', 'SPHINX_ENABLED', 'SPHINX_INDEX', 'ENABLE_REGISTRATION', 'REG_NOTIFY_ADDRESS', 'REG_MAX_USERS', 'SESSION_COOKIE_LIFETIME', 'SESSION_EXPIRE_TIME', 'SESSION_CHECK_ADDRESS', 'SMTP_FROM_NAME', 'SMTP_FROM_ADDRESS', 'DIGEST_SUBJECT', 'SMTP_HOST', 'SMTP_LOGIN', 'SMTP_PASSWORD', 'CHECK_FOR_NEW_VERSION', 'ENABLE_GZIP_OUTPUT', 'PLUGINS', 'FEEDBACK_URL', 'CONFIG_VERSION'); ?> $requred_defines = array( 'DB_TYPE', 'DB_HOST', 'DB_USER', 'DB_NAME', 'DB_PASS', 'MYSQL_CHARSET', 'SELF_URL_PATH', 'SINGLE_USER_MODE', 'SIMPLE_UPDATE_MODE', 'PHP_EXECUTABLE', 'LOCK_DIRECTORY', 'CACHE_DIR', 'ICONS_DIR', 'ICONS_URL', 'AUTH_AUTO_CREATE', 'AUTH_AUTO_LOGIN', 'FORCE_ARTICLE_PURGE', 'PUBSUBHUBBUB_HUB', 'PUBSUBHUBBUB_ENABLED', 'SPHINX_ENABLED', 'SPHINX_INDEX', 'ENABLE_REGISTRATION', 'REG_NOTIFY_ADDRESS', 'REG_MAX_USERS', 'SESSION_COOKIE_LIFETIME', 'SESSION_EXPIRE_TIME', 'SESSION_CHECK_ADDRESS', 'SMTP_FROM_NAME', 'SMTP_FROM_ADDRESS', 'DIGEST_SUBJECT', 'SMTP_HOST', 'SMTP_LOGIN', 'SMTP_PASSWORD', 'CHECK_FOR_NEW_VERSION', 'ENABLE_GZIP_OUTPUT', 'PLUGINS', 'FEEDBACK_URL', 'CONFIG_VERSION'); ?>