function PostgreSqlStore::delete
Overrides PersistingStoreInterface::delete
File
-
vendor/
symfony/ lock/ Store/ PostgreSqlStore.php, line 144
Class
- PostgreSqlStore
- PostgreSqlStore is a PersistingStoreInterface implementation using PostgreSql advisory locks.
Namespace
Symfony\Component\Lock\StoreCode
public function delete(Key $key) : void {
// Prevent deleting locks own by an other key in the same connection
if (!$this->exists($key)) {
return;
}
$this->unlock($key);
// Prevent deleting Readlocks own by current key AND an other key in the same connection
$store = $this->getInternalStore();
try {
// If lock acquired = there is no other ReadLock
$store->save($key);
$this->unlockShared($key);
} catch (LockConflictedException) {
// an other key exists in this ReadLock
}
$store->delete($key);
}