Skip to content

Commit 34f870e

Browse files
committed
Remove Prefix name length check;
1 parent 4dce93e commit 34f870e

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

lib/internal/Magento/Framework/Lock/Backend/Database.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Magento\Framework\App\ResourceConnection;
1212
use Magento\Framework\Config\ConfigOptionsListConstants;
1313
use Magento\Framework\Exception\AlreadyExistsException;
14-
use Magento\Framework\Exception\InputException;
1514
use Magento\Framework\Phrase;
1615
use Magento\Framework\DB\ExpressionConverter;
1716

@@ -69,7 +68,6 @@ public function __construct(
6968
* @param string $name lock name
7069
* @param int $timeout How long to wait lock acquisition in seconds, negative value means infinite timeout
7170
* @return bool
72-
* @throws InputException
7371
* @throws AlreadyExistsException
7472
* @throws \Zend_Db_Statement_Exception
7573
*/
@@ -111,7 +109,6 @@ public function lock(string $name, int $timeout = -1): bool
111109
*
112110
* @param string $name lock name
113111
* @return bool
114-
* @throws InputException
115112
* @throws \Zend_Db_Statement_Exception
116113
*/
117114
public function unlock(string $name): bool
@@ -139,7 +136,6 @@ public function unlock(string $name): bool
139136
*
140137
* @param string $name lock name
141138
* @return bool
142-
* @throws InputException
143139
* @throws \Zend_Db_Statement_Exception
144140
*/
145141
public function isLocked(string $name): bool
@@ -163,17 +159,12 @@ public function isLocked(string $name): bool
163159
*
164160
* @param string $name
165161
* @return string
166-
* @throws InputException
167162
*/
168163
private function addPrefix(string $name): string
169164
{
170165
$prefix = $this->getPrefix() ? $this->getPrefix() . '|' : '';
171166
$name = ExpressionConverter::shortenEntityName($prefix . $name, $prefix);
172167

173-
if (strlen($name) > 64) {
174-
throw new InputException(new Phrase('Lock name too long: %1...', [substr($name, 0, 64)]));
175-
}
176-
177168
return $name;
178169
}
179170

lib/internal/Magento/Framework/Lock/Test/Unit/Backend/DatabaseTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ protected function setUp()
8686

8787
/**
8888
* @throws \Magento\Framework\Exception\AlreadyExistsException
89-
* @throws \Magento\Framework\Exception\InputException
9089
* @throws \Zend_Db_Statement_Exception
9190
*/
9291
public function testLock()
@@ -104,7 +103,6 @@ public function testLock()
104103

105104
/**
106105
* @throws \Magento\Framework\Exception\AlreadyExistsException
107-
* @throws \Magento\Framework\Exception\InputException
108106
* @throws \Zend_Db_Statement_Exception
109107
*/
110108
public function testlockWithTooLongName()
@@ -122,7 +120,6 @@ public function testlockWithTooLongName()
122120

123121
/**
124122
* @throws \Magento\Framework\Exception\AlreadyExistsException
125-
* @throws \Magento\Framework\Exception\InputException
126123
* @throws \Zend_Db_Statement_Exception
127124
* @expectedException \Magento\Framework\Exception\AlreadyExistsException
128125
*/
@@ -142,7 +139,6 @@ public function testlockWithAlreadyAcquiredLockInSameSession()
142139

143140
/**
144141
* @throws \Magento\Framework\Exception\AlreadyExistsException
145-
* @throws \Magento\Framework\Exception\InputException
146142
* @throws \Zend_Db_Statement_Exception
147143
*/
148144
public function testLockWithUnavailableDeploymentConfig()
@@ -156,7 +152,6 @@ public function testLockWithUnavailableDeploymentConfig()
156152
}
157153

158154
/**
159-
* @throws \Magento\Framework\Exception\InputException
160155
* @throws \Zend_Db_Statement_Exception
161156
*/
162157
public function testUnlockWithUnavailableDeploymentConfig()
@@ -170,7 +165,6 @@ public function testUnlockWithUnavailableDeploymentConfig()
170165
}
171166

172167
/**
173-
* @throws \Magento\Framework\Exception\InputException
174168
* @throws \Zend_Db_Statement_Exception
175169
*/
176170
public function testIsLockedWithUnavailableDB()

0 commit comments

Comments
 (0)