okapi r608

This commit is contained in:
following
2013-03-30 18:13:59 +01:00
parent 3988af84a9
commit 45b90b03a5
10 changed files with 180 additions and 51 deletions

View File

@ -60,6 +60,29 @@ class View
}
public static function call()
{
# First, let's acquire a lock to make sure the update isn't already running.
# We will use one of the existing lock handles, because we don't want to use
# to many of them. See issue 141.
$lock = OkapiLock::get('cronjobs-cron-5');
$lock->acquire();
try
{
self::_call();
$lock->release();
}
catch (Exception $e)
{
# Error occured. Make sure the lock is released and rethrow.
$lock->release();
throw $e;
}
}
private static function _call()
{
ignore_user_abort(true);
set_time_limit(0);