From 6d77e5451c9c3a2ae283258427e743b2e5c72ddd Mon Sep 17 00:00:00 2001 From: "francesco.teofilo" Date: Tue, 12 Mar 2024 15:59:31 +0100 Subject: [PATCH] fix bug scandi pq flush on magento 2.4.6 --- src/Console/Command/PersistedQueryFlushCommand.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Console/Command/PersistedQueryFlushCommand.php b/src/Console/Command/PersistedQueryFlushCommand.php index 1ca6176..2a48dad 100644 --- a/src/Console/Command/PersistedQueryFlushCommand.php +++ b/src/Console/Command/PersistedQueryFlushCommand.php @@ -53,9 +53,13 @@ protected function configure() */ public function execute(InputInterface $input, OutputInterface $output) { - if ($this->query->clean()) { + $success = $this->query->clean(); + + if ($success) { $output->writeln('Persisted query caches flushed (redis + varnish)'); } - } + + return $success ? 0 : 1; // Returns 0 for success, 1 for failure. Fixes scandipwa:pq:flush launch error on Magento 2.4.6 that says the return of an execute function must be of type int. + } }