From 6b1a4ecd41ef6cbb9154ceec541b33322bad2dfc Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 22 Jan 2013 20:07:34 +0400 Subject: [PATCH] updaterandomfeed: use max_execution_time parameter --- classes/rpc.php | 2 +- config.php-dist | 5 +++++ include/functions.php | 2 +- include/sanity_config.php | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/classes/rpc.php b/classes/rpc.php index 0e93cd32..b4afc602 100644 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -699,7 +699,7 @@ class RPC extends Handler_Protected { while ($line = db_fetch_assoc($result)) { $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); ++$num_updated; } else { diff --git a/config.php-dist b/config.php-dist index e0949c61..85aad41f 100644 --- a/config.php-dist +++ b/config.php-dist @@ -28,6 +28,11 @@ // Operate in single user mode, disables all functionality related to // 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 *** // ***************************** diff --git a/include/functions.php b/include/functions.php index 089bbd8a..0e1800f2 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1968,7 +1968,7 @@ $params["csrf_token"] = $_SESSION["csrf_token"]; $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; } diff --git a/include/sanity_config.php b/include/sanity_config.php index 04058560..f6ec487b 100644 --- a/include/sanity_config.php +++ b/include/sanity_config.php @@ -1,3 +1,3 @@ - +$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'); ?> -- 2.39.5