File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,23 @@ to reset the TTL to its original value::
143
143
$lock->release();
144
144
}
145
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
+
146
163
Available Stores
147
164
----------------
148
165
You can’t perform that action at this time.
0 commit comments