-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "Disable Product Stream Indexer" checker (#299)
* Add "Disable Product Stream Indexer" checker * Don't activate indexing for versions that do not have the parameter
- Loading branch information
Showing
2 changed files
with
47 additions
and
22 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/Components/Health/Checker/PerformanceChecker/ProductStreamIndexingChecker.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Frosh\Tools\Components\Health\Checker\PerformanceChecker; | ||
|
||
use Frosh\Tools\Components\Health\Checker\CheckerInterface; | ||
use Frosh\Tools\Components\Health\HealthCollection; | ||
use Frosh\Tools\Components\Health\SettingsResult; | ||
use Symfony\Component\DependencyInjection\Attribute\Autowire; | ||
|
||
class ProductStreamIndexingChecker implements PerformanceCheckerInterface, CheckerInterface | ||
{ | ||
public function __construct( | ||
#[Autowire(param: 'shopware.product_stream.indexing')] | ||
private readonly bool $productStreamIndexingEnabled, | ||
) {} | ||
|
||
public function collect(HealthCollection $collection): void | ||
{ | ||
if ($this->productStreamIndexingEnabled) { | ||
$collection->add( | ||
SettingsResult::info( | ||
'product-stream-indexing', | ||
'Product Stream Indexing', | ||
'enabled', | ||
'disabled', | ||
'https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks.html#disable-product-stream-indexer', | ||
), | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters