Skip to content

Use separate ttl and ttw in LockManager#8

Open
mkhrystunov wants to merge 3 commits intopaysera:masterfrom
mkhrystunov:SUPPORT-77360-ttw-and-ttl
Open

Use separate ttl and ttw in LockManager#8
mkhrystunov wants to merge 3 commits intopaysera:masterfrom
mkhrystunov:SUPPORT-77360-ttw-and-ttl

Conversation

@mkhrystunov
Copy link

@mkhrystunov mkhrystunov commented Aug 2, 2023

Atm LockManager has ttl parameter, but it's not being passed to the LockFactory::createLock. This creates a bit of confusion, because without checking the inside of the bundle it is not clear that ttl is not used fully.

After the upgrade

  • old ttl parameter is renamed to ttw (Time to Wait) with same default value as it was
  • new ttl parameter is added which can be configured separately from ttw and will be passed to LockFactory::createLock

public function createLock(string $resource): LockInterface
{
return $this->lockFactory->createLock($resource, null);
return $this->lockFactory->createLock($resource, $this->ttl);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear why we even need to add ttl here. Why it was bad that it was null? Redis lock is not the same as resource lock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants