Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
fabpot merged 1 commit intosymfony:masterfromjderusse:lock-refresh-ttl
Feb 19, 2018

Conversation

@jderusse
Copy link
Member

@jderussejderusse commentedFeb 19, 2018
edited by javiereguiluz
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?see LockInterface's comment
Tests pass?yes
Fixed ticketsNA
LicenseMIT
Doc PRNA

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

$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();

* @throws LockAcquiringException If the lock can not be refreshed
*/
publicfunctionrefresh();
publicfunctionrefresh(/* $ttl = null */);
Copy link
MemberAuthor

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?

Copy link
Contributor

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
Copy link
Member

Thank you@jderusse.

@fabpotfabpot merged commit3b1f328 intosymfony:masterFeb 19, 2018
fabpot added a commit that referenced this pull requestFeb 19, 2018
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
@fabpotfabpot mentioned this pull requestMay 7, 2018
@jderussejderusse deleted the lock-refresh-ttl branchAugust 2, 2019 12:17
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@SimperfitSimperfitSimperfit approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

5 participants

@jderusse@fabpot@nicolas-grekas@Simperfit@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp