8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f123c6 commit 6597d4eCopy full SHA for 6597d4e
components/lock.rst
@@ -143,6 +143,23 @@ to reset the TTL to its original value::
143
$lock->release();
144
}
145
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
163
Available Stores
164
----------------
165
0 commit comments