Skip to content

Commit

Permalink
MDEE-608: Clean feed table only if reindex process unlocked (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
le0n4ik authored Feb 23, 2024
1 parent 9b3712c commit d3bf102
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions DataExporter/Model/Indexer/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class Config
*/
private const EXPORTER_CONTINUE_RESYNC = 'continue-resync';

private const EXPORTER_CLEAN_UP_FEED = 'cleanup-feed';

private const EXPORTER_DRY_RUN = 'dry-run';

/**
* @var ScopeConfigInterface
*/
Expand Down Expand Up @@ -129,4 +133,26 @@ public function isResyncShouldBeContinued(): bool
$configOptions = $this->configOptionsHandler->getConfigOptionsPool();
return $configOptions->getFeedOption(self::EXPORTER_CONTINUE_RESYNC) ?? false;
}

/**
* Check if feed table should be cleaned up before export
*
* @return bool
*/
public function isCleanUpFeed(): bool
{
$configOptions = $this->configOptionsHandler->getConfigOptionsPool();
return $configOptions->getFeedOption(self::EXPORTER_CLEAN_UP_FEED) ?? false;
}

/**
* Check if dry run mode is enabled
*
* @return bool
*/
public function isDryRun(): bool
{
$configOptions = $this->configOptionsHandler->getConfigOptionsPool();
return $configOptions->getFeedOption(self::EXPORTER_DRY_RUN) ?? false;
}
}

0 comments on commit d3bf102

Please sign in to comment.