Skip to content

Commit d110610

Browse files
committed
MAGETWO-52660: Improve performance of static assets deployment
- MAGETWO-57913: Mysql connections is lost if forked process
1 parent 83eac3e commit d110610

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/internal/Magento/Framework/View/Asset/LockerProcess.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public function __construct(Filesystem $filesystem)
5959

6060
/**
6161
* @inheritdoc
62-
* @throws FileSystemException
6362
*/
6463
public function lockProcess($lockName)
6564
{
@@ -94,14 +93,18 @@ public function unlockProcess()
9493
* Check whether generation process has already locked
9594
*
9695
* @return bool
97-
* @throws FileSystemException
9896
*/
9997
private function isProcessLocked()
10098
{
10199
if ($this->tmpDirectory->isExist($this->lockFilePath)) {
102-
$lockTime = (int) $this->tmpDirectory->readFile($this->lockFilePath);
103-
if ((time() - $lockTime) >= self::MAX_LOCK_TIME) {
104-
$this->tmpDirectory->delete($this->lockFilePath);
100+
try {
101+
$lockTime = (int)$this->tmpDirectory->readFile($this->lockFilePath);
102+
if ((time() - $lockTime) >= self::MAX_LOCK_TIME) {
103+
$this->tmpDirectory->delete($this->lockFilePath);
104+
105+
return false;
106+
}
107+
} catch (FileSystemException $e) {
105108

106109
return false;
107110
}

0 commit comments

Comments
 (0)