Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b7d19e1

Browse files
committed
Fixed the lock config
1 parent d31b7a6 commit b7d19e1

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

lock.rst

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,9 @@ this behavior by using the ``lock`` key like:
153153
->resource('lock', ['%env(LOCK_DSN)%'])
154154
155155
// named locks
156-
->resource('lock', [
157-
'invoice' => ['semaphore', 'redis://r2.docker'],
158-
'report' => 'semaphore',
159-
])
160-
;
156+
->resource('invoice', ['semaphore', 'redis://r2.docker'])
157+
->resource('report', ['semaphore'])
158+
;
161159
};
162160
163161
Locking a Resource
@@ -277,13 +275,12 @@ provides :ref:`named lock <reference-lock-resources-name>`:
277275
278276
return static function (FrameworkConfig $framework) {
279277
$framework->lock()
280-
->resource('lock', [
281-
'invoice' => ['semaphore', 'redis://r2.docker'],
282-
'report' => 'semaphore',
283-
])
278+
->resource('invoice', ['semaphore', 'redis://r2.docker'])
279+
->resource('report', ['semaphore']);
284280
;
285281
};
286282
283+
287284
Each name becomes a service where the service id is part of the name of the
288285
lock (e.g. ``lock.invoice.factory``). An autowiring alias is also created for
289286
each lock using the camel case version of its name suffixed by ``LockFactory``

0 commit comments

Comments
 (0)