Skip to content

Commit 77a2e3e

Browse files
authored
Merge pull request #232 from matomo-org/149-fix-test-command
Added code to skip maxmemory config check when --skip-max-memory-config-check=1, #149
2 parents fa2f39c + 9c9f1da commit 77a2e3e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Commands/Test.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class Test extends ConsoleCommand
3030
protected function configure()
3131
{
3232
$this->setName('queuedtracking:test');
33+
$this->addRequiredValueOption('skip-max-memory-config-check', null, 'Do not check for MaxMemory config values ');
3334
$this->setDescription('Test your Redis connection get some information about your current system.');
3435
}
3536

@@ -48,10 +49,13 @@ protected function configure()
4849

4950
protected function doExecute(): int
5051
{
52+
$input = $this->getInput();
5153
$output = $this->getOutput();
5254
$trackerEnvironment = new Environment('tracker');
5355
$trackerEnvironment->init();
5456

57+
$shouldSkipCheckingMemoryConfigValues = $input->getOption('skip-max-memory-config-check');
58+
5559
$settings = Queue\Factory::getSettings();
5660
$isUsingRedis = $settings->isRedisBackend();
5761

@@ -102,7 +106,7 @@ protected function doExecute(): int
102106
$output->writeln('Memory: ' . var_export($backend->getMemoryStats(), 1));
103107

104108
$redis = $backend->getConnection();
105-
if ($isUsingRedis) {
109+
if ($isUsingRedis && !$shouldSkipCheckingMemoryConfigValues) {
106110

107111
$evictionPolicy = $this->getRedisConfig($redis, 'maxmemory-policy');
108112
$output->writeln('MaxMemory Eviction Policy config: ' . $evictionPolicy);

0 commit comments

Comments
 (0)