From 0cac51a1247d95098339faf8d11eeea604849994 Mon Sep 17 00:00:00 2001 From: glix08 Date: Wed, 27 Jun 2012 18:26:04 +0000 Subject: [PATCH] r436 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Повышение отказоустойчивости - автоматическое пересоздание триггера для запуска крона, в случае его удаления. Более логичная очистка таблицы с результатами поиска. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@436 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- upload/config.php | 2 +- upload/includes/cron/cron_init.php | 5 +++++ upload/includes/cron/jobs/clean_search_results.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/upload/config.php b/upload/config.php index ef662f1f6..9ef14aa40 100644 --- a/upload/config.php +++ b/upload/config.php @@ -56,7 +56,7 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do // Increase number of revision after update $bb_cfg['tp_version'] = '2.5 Beta'; -$bb_cfg['tp_release_state'] = 'R435'; +$bb_cfg['tp_release_state'] = 'R436'; $bb_cfg['tp_release_date'] = '27-06-2012'; // Database diff --git a/upload/includes/cron/cron_init.php b/upload/includes/cron/cron_init.php index 330b6e227..6fcc664b0 100644 --- a/upload/includes/cron/cron_init.php +++ b/upload/includes/cron/cron_init.php @@ -19,6 +19,11 @@ function cron_get_file_lock () { cron_release_deadlock(); } + else if (!file_exists(CRON_ALLOWED) && !file_exists(CRON_RUNNING)) + { + file_write('', CRON_ALLOWED); + $lock_obtained = @rename(CRON_ALLOWED, CRON_RUNNING); + } return $lock_obtained; } diff --git a/upload/includes/cron/jobs/clean_search_results.php b/upload/includes/cron/jobs/clean_search_results.php index b9957e145..a15f76368 100644 --- a/upload/includes/cron/jobs/clean_search_results.php +++ b/upload/includes/cron/jobs/clean_search_results.php @@ -2,7 +2,7 @@ if (!defined('BB_ROOT')) die(basename(__FILE__)); -$search_results_expire = TIMENOW - ($bb_cfg['user_session_duration'] * 2) - 600; +$search_results_expire = TIMENOW - 3*3600; DB()->query(" DELETE FROM ". BB_SEARCH ."