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

Commita294625

Browse files
committed
minor#9399 Documented the dynamic lock refresh (javiereguiluz)
This PR was merged into the master branch.Discussion----------Documented the dynamic lock refreshThisfixes#9379.Commits-------6597d4e Documented the dynamic lock refresh
2 parents8f123c6 +6597d4e commita294625

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎components/lock.rst‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,23 @@ to reset the TTL to its original value::
143143
$lock->release();
144144
}
145145

146+
..tip::
147+
148+
Another useful technique for long-running tasks is to pass a custom TTL as
149+
an argument of the ``refresh()`` method to change the default lock TTL::
150+
151+
$lock = $factory->createLock('charts-generation', 30);
152+
// ...
153+
// refresh the lock for 30 seconds
154+
$lock->refresh();
155+
// ...
156+
// refresh the lock for 600 seconds (next refresh() call will be 30 seconds again)
157+
$lock->refresh(600);
158+
159+
..versionadded::4.1
160+
The feature to pass a custom TTL as an argument of the ``refresh()``
161+
method was introduced in Symfony 4.1.
162+
146163
Available Stores
147164
----------------
148165

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp