Skip to content

Commit 3317bcf

Browse files
oshmyheliukBohdan Korablov
authored andcommitted
MAGECLOUD-1582: The "disable_locking" parameter breaks 2.2.0 and doesn't required in >=2.2.2 (#151)
1 parent 95af179 commit 3317bcf

File tree

5 files changed

+1
-61
lines changed

5 files changed

+1
-61
lines changed

src/Config/Stage/Deploy.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ private function getEnvironmentConfig(): array
111111
}
112112

113113
$disabledFlow = [
114-
self::VAR_REDIS_SESSION_DISABLE_LOCKING,
115114
self::VAR_CLEAN_STATIC_FILES,
116115
self::VAR_STATIC_CONTENT_SYMLINK,
117116
self::VAR_UPDATE_URLS,
@@ -167,7 +166,6 @@ private function getDefault(): array
167166
return [
168167
self::VAR_SCD_STRATEGY => '',
169168
self::VAR_SCD_COMPRESSION_LEVEL => 4,
170-
self::VAR_REDIS_SESSION_DISABLE_LOCKING => true,
171169
self::VAR_SEARCH_CONFIGURATION => [],
172170
self::VAR_QUEUE_CONFIGURATION => [],
173171
self::VAR_VERBOSE_COMMANDS => '',

src/Config/Stage/DeployInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ interface DeployInterface extends StageConfigInterface
1414
{
1515
const VAR_QUEUE_CONFIGURATION = 'QUEUE_CONFIGURATION';
1616
const VAR_SEARCH_CONFIGURATION = 'SEARCH_CONFIGURATION';
17-
const VAR_REDIS_SESSION_DISABLE_LOCKING = 'REDIS_SESSION_DISABLE_LOCKING';
1817
const VAR_CRON_CONSUMERS_RUNNER = 'CRON_CONSUMERS_RUNNER';
1918
const VAR_CLEAN_STATIC_FILES = 'CLEAN_STATIC_FILES';
2019
const VAR_STATIC_CONTENT_SYMLINK = 'STATIC_CONTENT_SYMLINK';

src/Process/Deploy/InstallUpdate/ConfigUpdate/Redis.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ public function execute()
9696
'host' => $redisConfig[0]['host'],
9797
'port' => $redisConfig[0]['port'],
9898
'database' => 0,
99-
'disable_locking' => (int)$this->isLockingDisabled(),
10099
];
101100
$config['session'] = [
102101
'save' => 'redis',
@@ -139,16 +138,4 @@ private function removeRedisConfiguration($config)
139138

140139
return $config;
141140
}
142-
143-
/**
144-
* Checks if disable_locking options is enabled.
145-
* By default this method returns true and disable_locking options will be set to 1.
146-
* For turning this option off environment variable 'REDIS_SESSION_DISABLE_LOCKING' should have value 'disabled'.
147-
*
148-
* @return bool
149-
*/
150-
private function isLockingDisabled(): bool
151-
{
152-
return $this->stageConfig->get(DeployInterface::VAR_REDIS_SESSION_DISABLE_LOCKING);
153-
}
154141
}

src/Test/Unit/Config/Stage/DeployTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,6 @@ public function getDataProvider(): array
141141
[],
142142
'{"SOME_CONFIG": "some value',
143143
],
144-
'disabled flow 1' => [
145-
Deploy::VAR_REDIS_SESSION_DISABLE_LOCKING,
146-
[],
147-
[
148-
Deploy::VAR_REDIS_SESSION_DISABLE_LOCKING => EnvironmentConfig::VAL_DISABLED,
149-
],
150-
false,
151-
],
152144
'disabled flow 2' => [
153145
Deploy::VAR_UPDATE_URLS,
154146
[],

src/Test/Unit/Process/Deploy/InstallUpdate/ConfigUpdate/RedisTest.php

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,7 @@ protected function setUp()
7373
);
7474
}
7575

76-
/**
77-
* @param $envSessionLocking
78-
* @param int $expectedDisableLocking
79-
* @dataProvider executeDataProvider
80-
*/
81-
public function testExecute($envSessionLocking, int $expectedDisableLocking)
76+
public function testExecute()
8277
{
8378
$this->loggerMock->expects($this->once())
8479
->method('info')
@@ -96,10 +91,6 @@ public function testExecute($envSessionLocking, int $expectedDisableLocking)
9691
$this->environmentMock->expects($this->any())
9792
->method('getAdminUrl')
9893
->willReturn('admin');
99-
$this->stageConfigMock->expects($this->once())
100-
->method('get')
101-
->with(DeployInterface::VAR_REDIS_SESSION_DISABLE_LOCKING)
102-
->willReturn($envSessionLocking);
10394
$this->configReaderMock->expects($this->once())
10495
->method('read')
10596
->willReturn([]);
@@ -133,35 +124,13 @@ public function testExecute($envSessionLocking, int $expectedDisableLocking)
133124
'host' => '127.0.0.1',
134125
'port' => '6379',
135126
'database' => 0,
136-
'disable_locking' => $expectedDisableLocking,
137127
],
138128
],
139129
]);
140130

141131
$this->process->execute();
142132
}
143133

144-
/**
145-
* @return array
146-
*/
147-
public function executeDataProvider(): array
148-
{
149-
return [
150-
[
151-
true,
152-
1,
153-
],
154-
[
155-
false,
156-
0,
157-
],
158-
[
159-
true,
160-
1,
161-
],
162-
];
163-
}
164-
165134
public function testExecuteRemovingRedis()
166135
{
167136
$this->loggerMock->expects($this->once())
@@ -239,10 +208,6 @@ public function testExecuteWithDifferentRedisOptions()
239208
$this->environmentMock->expects($this->any())
240209
->method('getAdminUrl')
241210
->willReturn('admin');
242-
$this->stageConfigMock->expects($this->once())
243-
->method('get')
244-
->with(DeployInterface::VAR_REDIS_SESSION_DISABLE_LOCKING)
245-
->willReturn(true);
246211
$this->configReaderMock->expects($this->once())
247212
->method('read')
248213
->willReturn([
@@ -286,7 +251,6 @@ public function testExecuteWithDifferentRedisOptions()
286251
'host' => '127.0.0.1',
287252
'port' => '6379',
288253
'database' => 0,
289-
'disable_locking' => 1,
290254
'max_concurrency' => 10,
291255
'bot_first_lifetime' => 100,
292256
'bot_lifetime' => 10000,

0 commit comments

Comments
 (0)