You are here

private function ZeroConfigPurger::triageResults in Varnish purger 8.2

Set invalidation result states.

Parameters

\Drupal\purge\Plugin\Purge\Invalidation\InvalidationInterface[] $invalidations: The array of invalidations.

array $results: The array of result booleans, indexed by invalidation ID.

2 calls to ZeroConfigPurger::triageResults()
ZeroConfigPurger::invalidateUrls in src/Plugin/Purge/Purger/ZeroConfigPurger.php
Invalidate a set of URL invalidations.
ZeroConfigPurger::invalidateWildcardUrls in src/Plugin/Purge/Purger/ZeroConfigPurger.php
Invalidate URLs that contain the wildcard character "*".

File

src/Plugin/Purge/Purger/ZeroConfigPurger.php, line 544

Class

ZeroConfigPurger
A purger with minimal configuration required.

Namespace

Drupal\varnish_purger\Plugin\Purge\Purger

Code

private function triageResults(array $invalidations, array $results) {
  foreach ($invalidations as $invalidation) {
    $inv_id = $invalidation
      ->getId();
    if (!isset($results[$inv_id]) || !count($results[$inv_id])) {
      $invalidation
        ->setState(InvalidationInterface::FAILED);
    }
    else {
      if (in_array(FALSE, $results[$inv_id])) {
        $invalidation
          ->setState(InvalidationInterface::FAILED);
      }
      else {
        $invalidation
          ->setState(InvalidationInterface::SUCCEEDED);
      }
    }
  }
}