From 9c9f1daeb02fb65a39e9624707e8b7307079ff07 Mon Sep 17 00:00:00 2001 From: Altamash Shaikh Date: Fri, 1 Mar 2024 10:58:26 +0530 Subject: [PATCH] Added code to skip maxmemory config check when --skip-max-memory-config-chec=1, #149 --- Commands/Test.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Commands/Test.php b/Commands/Test.php index bd5e60d..92df691 100644 --- a/Commands/Test.php +++ b/Commands/Test.php @@ -30,6 +30,7 @@ class Test extends ConsoleCommand protected function configure() { $this->setName('queuedtracking:test'); + $this->addRequiredValueOption('skip-max-memory-config-check', null, 'Do not check for MaxMemory config values '); $this->setDescription('Test your Redis connection get some information about your current system.'); } @@ -48,10 +49,13 @@ protected function configure() protected function doExecute(): int { + $input = $this->getInput(); $output = $this->getOutput(); $trackerEnvironment = new Environment('tracker'); $trackerEnvironment->init(); + $shouldSkipCheckingMemoryConfigValues = $input->getOption('skip-max-memory-config-check'); + $settings = Queue\Factory::getSettings(); $isUsingRedis = $settings->isRedisBackend(); @@ -102,7 +106,7 @@ protected function doExecute(): int $output->writeln('Memory: ' . var_export($backend->getMemoryStats(), 1)); $redis = $backend->getConnection(); - if ($isUsingRedis) { + if ($isUsingRedis && !$shouldSkipCheckingMemoryConfigValues) { $evictionPolicy = $this->getRedisConfig($redis, 'maxmemory-policy'); $output->writeln('MaxMemory Eviction Policy config: ' . $evictionPolicy);