Skip to content

Commit a9a9b91

Browse files
billygilbertshiftedreality
authored andcommitted
MAGECLOUD-1618: Temporary Workaround to Clean-up "disable_locking" Parameter (#161)
1 parent 3317bcf commit a9a9b91

File tree

2 files changed

+76
-0
lines changed
  • src
    • Process/Deploy/InstallUpdate/ConfigUpdate
    • Test/Unit/Process/Deploy/InstallUpdate/ConfigUpdate

2 files changed

+76
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ public function execute()
104104
$redisSessionConfig
105105
),
106106
];
107+
108+
if (isset($config['session']['redis']['disable_locking'])) {
109+
$this->logger->info('Removing disable_locking env.php.');
110+
unset($config['session']['redis']['disable_locking']);
111+
}
107112
} else {
108113
$config = $this->removeRedisConfiguration($config);
109114
}

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

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,4 +262,75 @@ public function testExecuteWithDifferentRedisOptions()
262262

263263
$this->process->execute();
264264
}
265+
266+
public function testRemoveDisableLocking()
267+
{
268+
$this->loggerMock->expects($this->exactly(2))
269+
->method('info')
270+
->withConsecutive(
271+
[
272+
'Updating env.php Redis cache configuration.',
273+
],
274+
[
275+
'Removing disable_locking env.php.'
276+
]
277+
);
278+
$this->environmentMock->expects($this->any())
279+
->method('getRelationships')
280+
->willReturn([
281+
'redis' => [
282+
0 => [
283+
'host' => '127.0.0.1',
284+
'port' => '6379',
285+
],
286+
],
287+
]);
288+
$this->environmentMock->expects($this->any())
289+
->method('getAdminUrl')
290+
->willReturn('admin');
291+
$this->configReaderMock->expects($this->once())
292+
->method('read')
293+
->willReturn([
294+
'session' => [
295+
'redis' => [
296+
'disable_locking' => '1',
297+
],
298+
],
299+
]);
300+
301+
$this->configWriterMock->expects($this->once())
302+
->method('write')
303+
->with([
304+
'cache' => [
305+
'frontend' => [
306+
'default' => [
307+
'backend' => 'Cm_Cache_Backend_Redis',
308+
'backend_options' => [
309+
'server' => '127.0.0.1',
310+
'port' => '6379',
311+
'database' => 1,
312+
],
313+
],
314+
'page_cache' => [
315+
'backend' => 'Cm_Cache_Backend_Redis',
316+
'backend_options' => [
317+
'server' => '127.0.0.1',
318+
'port' => '6379',
319+
'database' => 1,
320+
],
321+
],
322+
],
323+
],
324+
'session' => [
325+
'save' => 'redis',
326+
'redis' => [
327+
'host' => '127.0.0.1',
328+
'port' => '6379',
329+
'database' => 0,
330+
],
331+
],
332+
]);
333+
334+
$this->process->execute();
335+
}
265336
}

0 commit comments

Comments
 (0)