@@ -105,12 +105,10 @@ to handle the rest of the job::
105105
106106 use App\Lock\RefreshTaxonomy;
107107 use Symfony\Component\Lock\Key;
108- use Symfony\Component\Lock\Lock;
109108
110109 $key = new Key('article.'.$article->getId());
111- $lock = new Lock (
110+ $lock = $factory->createLockFromKey (
112111 $key,
113- $this->store,
114112 300, // ttl
115113 false // autoRelease
116114 );
@@ -121,7 +119,7 @@ to handle the rest of the job::
121119.. note ::
122120
123121 Don't forget to set the ``autoRelease `` argument to ``false `` in the
124- ``Lock `` constructor to avoid releasing the lock when the destructor is
122+ ``Lock `` instantiation to avoid releasing the lock when the destructor is
125123 called.
126124
127125Not all stores are compatible with serialization and cross-process locking: for
@@ -388,20 +386,20 @@ Locks are created and managed in ``Stores``, which are classes that implement
388386
389387The component includes the following built-in store types:
390388
391- ========================================================== ====== ======== ======== =======
392- Store Scope Blocking Expiring Sharing
393- ========================================================== ====== ======== ======== =======
394- :ref: `FlockStore <lock-store-flock >` local yes no yes
395- :ref: `MemcachedStore <lock-store-memcached >` remote no yes no
396- :ref: `MongoDbStore <lock-store-mongodb >` remote no yes no
397- :ref: `PdoStore <lock-store-pdo >` remote no yes no
398- :ref: `DoctrineDbalStore <lock-store-dbal >` remote no yes no
399- :ref: `PostgreSqlStore <lock-store-pgsql >` remote yes no yes
400- :ref: `DoctrineDbalPostgreSqlStore <lock-store-dbal-pgsql >` remote yes no yes
401- :ref: `RedisStore <lock-store-redis >` remote no yes yes
402- :ref: `SemaphoreStore <lock-store-semaphore >` local yes no no
403- :ref: `ZookeeperStore <lock-store-zookeeper >` remote no no no
404- ========================================================== ====== ======== ======== =======
389+ ========================================================== ====== ======== ======== ======= =============
390+ Store Scope Blocking Expiring Sharing Serialization
391+ ========================================================== ====== ======== ======== ======= =============
392+ :ref: `FlockStore <lock-store-flock >` local yes no yes no
393+ :ref: `MemcachedStore <lock-store-memcached >` remote no yes no yes
394+ :ref: `MongoDbStore <lock-store-mongodb >` remote no yes no yes
395+ :ref: `PdoStore <lock-store-pdo >` remote no yes no yes
396+ :ref: `DoctrineDbalStore <lock-store-dbal >` remote no yes no yes
397+ :ref: `PostgreSqlStore <lock-store-pgsql >` remote yes no yes no
398+ :ref: `DoctrineDbalPostgreSqlStore <lock-store-dbal-pgsql >` remote yes no yes no
399+ :ref: `RedisStore <lock-store-redis >` remote no yes yes yes
400+ :ref: `SemaphoreStore <lock-store-semaphore >` local yes no no no
401+ :ref: `ZookeeperStore <lock-store-zookeeper >` remote no no no no
402+ ========================================================== ====== ======== ======== ======= =============
405403
406404.. tip ::
407405
0 commit comments