You are here

public function QueueWorker::rebuildQueue in Simple XML sitemap 8.3

Same name and namespace in other branches
  1. 4.x src/Queue/QueueWorker.php \Drupal\simple_sitemap\Queue\QueueWorker::rebuildQueue()

Parameters

string[]|string|null $variants:

Return value

$this

Throws

\Drupal\Component\Plugin\Exception\PluginException

1 call to QueueWorker::rebuildQueue()
QueueWorker::generateSitemap in src/Queue/QueueWorker.php

File

src/Queue/QueueWorker.php, line 196

Class

QueueWorker

Namespace

Drupal\simple_sitemap\Queue

Code

public function rebuildQueue($variants = NULL) {
  if (!$this->lock
    ->acquire(static::LOCK_ID)) {
    throw new \RuntimeException('Unable to acquire a lock for sitemap queue rebuilding');
  }
  $this
    ->deleteQueue();
  $this
    ->queue($variants);
  $this->lock
    ->release(static::LOCK_ID);
  return $this;
}