Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Admin settings are located in Stores -> Configuration -> Advanced -> System -> Stuck Indexer Fixer

...

Settings:

Field

Options

Comment

Enable Automatic Stuck Indexes Fixing

Yes/No 

When enabled indexing that got somehow stuck will be automatically detected and fixed

Shoud enable suspended indexes

Yes/No 

When enabled indexing that got suspended will be automatically detected and fixed

Threshold to mark indexer as stuck

How long (in minutes) from the last activity must pass for indexer in a "working" status to treat it as stuck.

Cron expression for scheduling the fixer

Use Crontab Format (Eg. "*/5 * * * *" for every 5 minutes) | https://en.wikipedia.org/wiki/Cron

Backend

Note

In progress

Cron

vendor/creativestyle/magesuite-stuck-indexers-fixer/Cron/FixStuckIndexers.php:14
Code Block
class FixStuckIndexers
{
    public function execute()
    {
        $this->fixStuckIndexers->execute();
    }
}

vendor/creativestyle/magesuite-stuck-indexers-fixer/Model/FixStuckIndexers.php:24

Code Block
breakoutModewide
class FixStuckIndexers
{
    public function execute()
    {
        if ($this->configuration->shouldEnableSuspendedIndexes()) {
            $this->fixSuspendedIndexes();
        }

        if (!$this->configuration->isAutomaticFixingEnabled()) {
            return;
        }

        $thresholdToMarkIndexerAsStuck = $this->configuration->getThresholdToMarkIndexerAsStuck();

        $this->fixStuckIndexers($thresholdToMarkIndexerAsStuck);
    }

    protected function fixSuspendedIndexes()
    {
        $suspendedMview = $this->mviewState->getSuspendedIndexers() ?? [];

        foreach ($suspendedMview as $mview) {
            $this->mviewState->setIndexerAsIdle($mview['view_id']);
            .....
        }
    }

    protected function fixStuckIndexers($threshold)
    {
        $stuckMview = $this->mviewState->getStuckIndexers($threshold) ?? [];

        foreach ($stuckMview as $mview) {
            $this->mviewState->setIndexerAsIdle($mview['view_id']);
            .....
        }

        $stuckFull = $this->indexerState->getStuckIndexers($threshold) ?? [];

        foreach ($stuckFull as $indexer) {
            $this->indexerState->setIndexerAsInvalid($indexer['indexer_id']);
            .....
        }
    }
}

Frontend

There are no frontend features in the module.