function Cron::setCronLastTime

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Cron.php \Drupal\Core\Cron::setCronLastTime()
  2. 8.9.x core/lib/Drupal/Core/Cron.php \Drupal\Core\Cron::setCronLastTime()
  3. 10 core/lib/Drupal/Core/Cron.php \Drupal\Core\Cron::setCronLastTime()

Records and logs the request time for this cron invocation.

1 call to Cron::setCronLastTime()
Cron::run in core/lib/Drupal/Core/Cron.php
Executes a cron run.

File

core/lib/Drupal/Core/Cron.php, line 120

Class

Cron
The Drupal core Cron service.

Namespace

Drupal\Core

Code

protected function setCronLastTime() {
    // Record cron time.
    $request_time = $this->time
        ->getRequestTime();
    $this->state
        ->set('system.cron_last', $request_time);
    $this->logger
        ->info('Cron run completed.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.