Compare commits
No commits in common. "master" and "v1.0.4" have entirely different histories.
2 changed files with 3 additions and 9 deletions
|
@ -21,15 +21,9 @@ class LockableMessageMiddleware implements MiddlewareInterface
|
|||
*/
|
||||
private $lockFactory;
|
||||
|
||||
/**
|
||||
* @var int|null
|
||||
*/
|
||||
private $ttl;
|
||||
|
||||
public function __construct(LockFactory $lockFactory, int $ttl = null)
|
||||
public function __construct(LockFactory $lockFactory)
|
||||
{
|
||||
$this->lockFactory = $lockFactory;
|
||||
$this->ttl = $ttl;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -45,7 +39,7 @@ class LockableMessageMiddleware implements MiddlewareInterface
|
|||
$message = $envelope->getMessage();
|
||||
|
||||
if ($envelope->all(ReceivedStamp::class) && $message instanceof LockableMessage) {
|
||||
$lock = $this->lockFactory->createLock($this->objectHash($message), $this->ttl);
|
||||
$lock = $this->lockFactory->createLock($this->objectHash($message), null);
|
||||
if (!$lock->acquire()) {
|
||||
return $envelope;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"symfony/framework-bundle": "^4.0|^5.0",
|
||||
"symfony/serializer": "^5.2",
|
||||
"symfony/http-kernel": "^4.0|^5.0",
|
||||
"symfony/validator": "^4.0|^5.3",
|
||||
"symfony/validator": "^4.0|^5.0",
|
||||
"symfony/security-guard": "^4.0|^5.0",
|
||||
"symfony/console": "^5.2",
|
||||
"symfony/messenger": "^5.2",
|
||||
|
|
Loading…
Add table
Reference in a new issue