You are here

public function QueueService::reload in Purge 8.3

Reload the service and reinstantiate all enabled plugins.

@warning Reloading a service implies that all cached data will be reset and that plugins get reinstantiated during the current request, which should normally not be used. This method is specifically used in tests.

Overrides ServiceBase::reload

1 call to QueueService::reload()
QueueService::setPluginsEnabled in src/Plugin/Purge/Queue/QueueService.php
Set the plugins used by the service and reload it.

File

src/Plugin/Purge/Queue/QueueService.php, line 483

Class

QueueService
Provides the service that lets invalidations interact with a queue backend.

Namespace

Drupal\purge\Plugin\Purge\Queue

Code

public function reload() {
  parent::reload();
  if (!is_null($this->queue)) {
    $this
      ->commit(FALSE);
  }
  $this->buffer
    ->deleteEverything();

  // phpcs:ignore DrupalPractice.Objects.GlobalDrupal.GlobalDrupal -- We're already injecting, this is needed for tests to work.
  $this->configFactory = \Drupal::configFactory();
  $this->queue = NULL;
}