X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FLock.php;h=e8c8a7041605b0826be5912722f7e9b75629de5d;hb=f786e8984f1bd61a617f00a3e312181846ab40dd;hp=9892f1f4e4d7e74e2dcab9212da8a09f4943401f;hpb=74d5eec5719ef060e9dbcc36979731d1a1ecea7a;p=friendica.git diff --git a/src/Core/Lock.php b/src/Core/Lock.php index 9892f1f4e4..e8c8a70416 100644 --- a/src/Core/Lock.php +++ b/src/Core/Lock.php @@ -1,12 +1,12 @@ getMessage()); + Logger::log('Using Semaphore driver for locking failed: ' . $exception->getMessage()); } } @@ -83,7 +83,7 @@ class Lock } return; } catch (\Exception $exception) { - logger('Using Cache driver for locking failed: ' . $exception->getMessage()); + Logger::log('Using Cache driver for locking failed: ' . $exception->getMessage()); } } @@ -110,12 +110,13 @@ class Lock * * @param string $key Name of the lock * @param integer $timeout Seconds until we give up + * @param integer $ttl The Lock lifespan, must be one of the Cache constants * * @return boolean Was the lock successful? */ - public static function acquire($key, $timeout = 120) + public static function acquire($key, $timeout = 120, $ttl = Cache::FIVE_MINUTES) { - return self::getDriver()->acquireLock($key, $timeout); + return self::getDriver()->acquireLock($key, $timeout, $ttl); } /**