aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/cron.php
diff options
context:
space:
mode:
authorLEZY Thomas <thomas.gif.91@gmail.com>2014-05-28 12:57:49 +0200
committerLEZY Thomas <thomas.gif.91@gmail.com>2014-05-28 12:57:49 +0200
commit9761c1bf617763671308fabc569ec13d40cb6843 (patch)
tree96e0f4e3a3ca2d86055917826668f2dc8d6b53df /phpBB/cron.php
parent6f0121e2a49eca777f6767f5c254878f7a255fa9 (diff)
downloadforums-9761c1bf617763671308fabc569ec13d40cb6843.tar
forums-9761c1bf617763671308fabc569ec13d40cb6843.tar.gz
forums-9761c1bf617763671308fabc569ec13d40cb6843.tar.bz2
forums-9761c1bf617763671308fabc569ec13d40cb6843.tar.xz
forums-9761c1bf617763671308fabc569ec13d40cb6843.zip
[ticket/12597] Fix various refactoring mistakes
PHPBB3-12597
Diffstat (limited to 'phpBB/cron.php')
-rw-r--r--phpBB/cron.php20
1 files changed, 3 insertions, 17 deletions
diff --git a/phpBB/cron.php b/phpBB/cron.php
index c708527d99..b35d16632a 100644
--- a/phpBB/cron.php
+++ b/phpBB/cron.php
@@ -33,20 +33,6 @@ function output_image()
flush();
}
-function do_cron($cron_lock, $run_tasks)
-{
- global $config;
-
- foreach ($run_tasks as $task)
- {
- $task->run();
- }
-
- // Unloading cache and closing db after having done the dirty work.
- $cron_lock->release();
- garbage_collection();
-}
-
// Thanks to various fatal errors and lack of try/finally, it is quite easy to leave
// the cron lock locked, especially when working on cron-related code.
//
@@ -65,7 +51,6 @@ if ($cron_lock->acquire())
$cron = $phpbb_container->get('cron.manager');
// If invalid task is specified, empty $run_tasks is passed to do_cron which then does nothing
- $run_tasks = array();
$task = $cron->find_task($cron_type);
if ($task)
{
@@ -75,11 +60,12 @@ if ($cron_lock->acquire())
}
if ($task->is_ready())
{
- $run_tasks = array($task);
+ $task->run();
+ $cron_lock->release();
+ garbage_collection();
}
}
- do_cron($cron_lock, $run_tasks);
}
else
{