Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expiring lock stores & lock's TTL fixes #96

Open
wants to merge 5 commits into
base: 3.8
Choose a base branch
from

Conversation

G81BVfaN
Copy link

@G81BVfaN G81BVfaN commented Nov 21, 2024

  • Adding the possibility to specify a TTL (Time To Live) for the lock.
  • Stop refreshing the lock's TTL, if the lock store supports expiring.

@G81BVfaN G81BVfaN mentioned this pull request Nov 21, 2024
@PabloKowalczyk
Copy link
Member

Please do rebase

@G81BVfaN G81BVfaN force-pushed the expiring_lock_stores_fix branch from be85011 to cb4e1b8 Compare November 22, 2024 09:47
@G81BVfaN
Copy link
Author

Done, but the rebase brought a lot of commits to the PR that we don't need here in the upstream 🫢

@G81BVfaN G81BVfaN force-pushed the expiring_lock_stores_fix branch from cb4e1b8 to 4004aba Compare November 22, 2024 10:42
@G81BVfaN
Copy link
Author

G81BVfaN commented Nov 22, 2024

Done, but the rebase brought a lot of commits to the PR that we don't need here in the upstream 🫢

Rookie mistake, i rebased with our fork's origin, instead of the upstream's origin 😅
Now it should be fine.

*/
public function preventOverlapping(?object $store = null)
public function preventOverlapping(?object $store = null, ?int $ttl = 30)
Copy link
Member

Choose a reason for hiding this comment

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

Why null is allowed?

$this->skip(function () {
$lock = $this->createLockObject();
$this->skip(function () use ($ttl) {
$lock = $this->createLockObject($ttl);
Copy link
Member

Choose a reason for hiding this comment

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

What about some tests?

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.

None yet

2 participants