You are here

public function QueueWorker::rebuildQueue in Simple XML sitemap 4.x

Same name and namespace in other branches
  1. 8.3 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 183

Class

QueueWorker

Namespace

Drupal\simple_sitemap\Queue

Code

public function rebuildQueue($variants = NULL) : QueueWorker {
  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;
}