You are here

public function WarmerPluginBase::isActive in Warmer 8

Same name and namespace in other branches
  1. 2.x src/Plugin/WarmerPluginBase.php \Drupal\warmer\Plugin\WarmerPluginBase::isActive()

Checks if the plugin should warm in this particular moment.

Return value

bool TRUE if the warmer is active. FALSE otherwise.

Overrides WarmerInterface::isActive

File

src/Plugin/WarmerPluginBase.php, line 182

Class

WarmerPluginBase
Base class for warmer plugins that implement settings forms.

Namespace

Drupal\warmer\Plugin

Code

public function isActive() {
  $configuration = $this
    ->getConfiguration();
  $last_run = $this->state
    ->get('previous_enqueue_time:' . $configuration['id']);
  return $this->time
    ->getRequestTime() > $last_run + $this
    ->getFrequency();
}