mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-12 01:54:41 +08:00
Ensured Redis lock store is wrapped into a retry adapter
This commit is contained in:
18
module/Common/src/Lock/RetryLockStoreDelegatorFactory.php
Normal file
18
module/Common/src/Lock/RetryLockStoreDelegatorFactory.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\Common\Lock;
|
||||
|
||||
use Interop\Container\ContainerInterface;
|
||||
use Symfony\Component\Lock\Store\RetryTillSaveStore;
|
||||
use Symfony\Component\Lock\StoreInterface;
|
||||
|
||||
class RetryLockStoreDelegatorFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container, $name, callable $callback): RetryTillSaveStore
|
||||
{
|
||||
/** @var StoreInterface $originalStore */
|
||||
$originalStore = $callback();
|
||||
return new RetryTillSaveStore($originalStore);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user