Skip to content

Commit 63063bc

Browse files
committed
#22880 Fix random fails during parallel SCD execution
No need to use locks when running in CLI mode
1 parent 605ae1e commit 63063bc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __construct(Filesystem $filesystem)
6262
*/
6363
public function lockProcess($lockName)
6464
{
65-
if ($this->getState()->getMode() == State::MODE_PRODUCTION) {
65+
if ($this->getState()->getMode() === State::MODE_PRODUCTION || PHP_SAPI === 'cli') {
6666
return;
6767
}
6868

@@ -78,11 +78,12 @@ public function lockProcess($lockName)
7878

7979
/**
8080
* @inheritdoc
81+
*
8182
* @throws FileSystemException
8283
*/
8384
public function unlockProcess()
8485
{
85-
if ($this->getState()->getMode() == State::MODE_PRODUCTION) {
86+
if ($this->getState()->getMode() === State::MODE_PRODUCTION || PHP_SAPI === 'cli') {
8687
return;
8788
}
8889

@@ -115,9 +116,10 @@ private function isProcessLocked()
115116
}
116117

117118
/**
118-
* Get name of lock file
119+
* Get path to lock file
119120
*
120121
* @param string $name
122+
*
121123
* @return string
122124
*/
123125
private function getFilePath($name)
@@ -126,7 +128,10 @@ private function getFilePath($name)
126128
}
127129

128130
/**
131+
* Get State object
132+
*
129133
* @return State
134+
*
130135
* @deprecated 100.1.1
131136
*/
132137
private function getState()

0 commit comments

Comments
 (0)