mirror of
https://github.com/friendica/friendica
synced 2025-04-24 22:30:11 +00:00
Added Unittests for cache
fixed Lock & Cache bugs
This commit is contained in:
parent
1dafaa69c5
commit
80a4e6263f
18 changed files with 317 additions and 25 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Friendica\Core\Lock;
|
||||
|
||||
use Friendica\Core\Cache;
|
||||
|
||||
class SemaphoreLockDriver extends AbstractLockDriver
|
||||
{
|
||||
private static $semaphore = [];
|
||||
|
@ -30,10 +32,9 @@ class SemaphoreLockDriver extends AbstractLockDriver
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* (@inheritdoc)
|
||||
*/
|
||||
public function acquireLock($key, $timeout = 120)
|
||||
public function acquireLock($key, $timeout = 120, $ttl = Cache::FIVE_MINUTES)
|
||||
{
|
||||
self::$semaphore[$key] = sem_get(self::semaphoreKey($key));
|
||||
if (self::$semaphore[$key]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue