@@ -108,12 +108,10 @@ to handle the rest of the job::
108108
109109 use App\Lock\RefreshTaxonomy;
110110 use Symfony\Component\Lock\Key;
111- use Symfony\Component\Lock\Lock;
112111
113112 $key = new Key('article.'.$article->getId());
114- $lock = new Lock (
113+ $lock = $factory->createLockFromKey (
115114 $key,
116- $this->store,
117115 300, // ttl
118116 false // autoRelease
119117 );
@@ -124,7 +122,7 @@ to handle the rest of the job::
124122.. note ::
125123
126124 Don't forget to set the ``autoRelease `` argument to ``false `` in the
127- ``Lock `` constructor to avoid releasing the lock when the destructor is
125+ ``Lock `` instantiation to avoid releasing the lock when the destructor is
128126 called.
129127
130128Not all stores are compatible with serialization and cross-process locking: for
@@ -402,20 +400,20 @@ Locks are created and managed in ``Stores``, which are classes that implement
402400
403401The component includes the following built-in store types:
404402
405- ========================================================== ====== ======== ======== =======
406- Store Scope Blocking Expiring Sharing
407- ========================================================== ====== ======== ======== =======
408- :ref: `FlockStore <lock-store-flock >` local yes no yes
409- :ref: `MemcachedStore <lock-store-memcached >` remote no yes no
410- :ref: `MongoDbStore <lock-store-mongodb >` remote no yes no
411- :ref: `PdoStore <lock-store-pdo >` remote no yes no
412- :ref: `DoctrineDbalStore <lock-store-dbal >` remote no yes no
413- :ref: `PostgreSqlStore <lock-store-pgsql >` remote yes no yes
414- :ref: `DoctrineDbalPostgreSqlStore <lock-store-dbal-pgsql >` remote yes no yes
415- :ref: `RedisStore <lock-store-redis >` remote no yes yes
416- :ref: `SemaphoreStore <lock-store-semaphore >` local yes no no
417- :ref: `ZookeeperStore <lock-store-zookeeper >` remote no no no
418- ========================================================== ====== ======== ======== =======
403+ ========================================================== ====== ======== ======== ======= =============
404+ Store Scope Blocking Expiring Sharing Serialization
405+ ========================================================== ====== ======== ======== ======= =============
406+ :ref: `FlockStore <lock-store-flock >` local yes no yes no
407+ :ref: `MemcachedStore <lock-store-memcached >` remote no yes no yes
408+ :ref: `MongoDbStore <lock-store-mongodb >` remote no yes no yes
409+ :ref: `PdoStore <lock-store-pdo >` remote no yes no yes
410+ :ref: `DoctrineDbalStore <lock-store-dbal >` remote no yes no yes
411+ :ref: `PostgreSqlStore <lock-store-pgsql >` remote yes no yes no
412+ :ref: `DoctrineDbalPostgreSqlStore <lock-store-dbal-pgsql >` remote yes no yes no
413+ :ref: `RedisStore <lock-store-redis >` remote no yes yes yes
414+ :ref: `SemaphoreStore <lock-store-semaphore >` local yes no no no
415+ :ref: `ZookeeperStore <lock-store-zookeeper >` remote no no no no
416+ ========================================================== ====== ======== ======== ======= =============
419417
420418.. tip ::
421419
0 commit comments