Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Lock] Add a TTL to refresh lock#26232
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| * @throws LockAcquiringException If the lock can not be refreshed | ||
| */ | ||
| publicfunctionrefresh(); | ||
| publicfunctionrefresh(/* $ttl = null */); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm not such this is the right way to keep BC layer on interfaces. ping@nicolas-grekas
Is there a way to trigger a deprecation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Maybe you can trigger a deprecation in the interface likee8351d8#diff-7994cccf0d9c75a5a481e1240a159cce
fabpot commentedFeb 19, 2018
Thank you@jderusse. |
This PR was merged into the 4.1-dev branch.Discussion----------[Lock] Add a TTL to refresh lock| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | see LockInterface's comment| Tests pass? | yes| Fixed tickets | NA| License | MIT| Doc PR | NAUsing remote locks in long processes needs to defines a fined grain refresh TTL. For instance, when looping over a long list of jobs we can extends the live of the lock by few seconds before processing each item.But when the the jobs is splitted and each part to take the same time, we can not define the best TTLExemple```$lock->acquire();$this->2minutesJob();$lock->refresh();$this->5minutesJob();$lock->refresh();$this->1minutesJob();```The purpose of this PR is to be able to override the default TTL```$lock->acquire();$lock->refresh(120);$this->2minutesJob();$lock->refresh(300);$this->5minutesJob();$lock->refresh(60);$this->1minutesJob();```Commits-------3b1f328 Add a TTL to refresh lock
Uh oh!
There was an error while loading.Please reload this page.
Using remote locks in long processes needs to defines a fined grain refresh TTL. For instance, when looping over a long list of jobs we can extends the live of the lock by few seconds before processing each item.
But when the the jobs is splitted and each part to take the same time, we can not define the best TTL
Exemple
The purpose of this PR is to be able to override the default TTL