diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-09-12 15:32:11 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-09-12 15:32:11 +0000 |
commit | e503216834c466de1eb5746d1b2998a8db5de086 (patch) | |
tree | 316a5c451d9188a35a629b457adc697df568a93f /phpBB/cron.php | |
parent | 01b46eb4e0cc637c0b3440a49a58580133679bb0 (diff) | |
download | forums-e503216834c466de1eb5746d1b2998a8db5de086.tar forums-e503216834c466de1eb5746d1b2998a8db5de086.tar.gz forums-e503216834c466de1eb5746d1b2998a8db5de086.tar.bz2 forums-e503216834c466de1eb5746d1b2998a8db5de086.tar.xz forums-e503216834c466de1eb5746d1b2998a8db5de086.zip |
some tiny fixes...
git-svn-id: file:///svn/phpbb/trunk@8087 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/cron.php')
-rw-r--r-- | phpBB/cron.php | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/phpBB/cron.php b/phpBB/cron.php index a4880b119f..18ed42dbae 100644 --- a/phpBB/cron.php +++ b/phpBB/cron.php @@ -259,18 +259,29 @@ switch ($cron_type) // Unloading cache and closing db after having done the dirty work. if ($use_shutdown_function) { + register_shutdown_function('unlock_cron'); register_shutdown_function('garbage_collection'); } else { + unlock_cron(); garbage_collection(); } -$sql = 'UPDATE ' . CONFIG_TABLE . " - SET config_value = '0' - WHERE config_name = 'cron_lock' AND config_value = '" . $db->sql_escape(CRON_ID) . "'"; -$db->sql_query($sql); - exit; + +/** +* Unlock cron script +*/ +function unlock_cron() +{ + global $db; + + $sql = 'UPDATE ' . CONFIG_TABLE . " + SET config_value = '0' + WHERE config_name = 'cron_lock' AND config_value = '" . $db->sql_escape(CRON_ID) . "'"; + $db->sql_query($sql); +} + ?>
\ No newline at end of file |