Ensured Redis lock store is wrapped into a retry adapter

This commit is contained in:
Alejandro Celaya
2019-08-07 17:37:24 +02:00
parent 04389fc8b0
commit 73fd348490
3 changed files with 65 additions and 0 deletions

View 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);
}
}