You are here

public function SchedulerCommands::cron in Scheduler 8

Same name and namespace in other branches
  1. 2.x src/Commands/SchedulerCommands.php \Drupal\scheduler\Commands\SchedulerCommands::cron()

Lightweight cron to process Scheduler module tasks.

@option nomsg to avoid the "cron completed" message being written to the terminal. @option nolog to overide the site setting and not write 'started' and 'completed' messages to the dblog.

@command scheduler:cron @aliases sch-cron, scheduler-cron

Parameters

array $options: An associative array of options whose values come from cli, aliases, config, etc.

File

src/Commands/SchedulerCommands.php, line 58

Class

SchedulerCommands
Drush 9 Scheduler commands for Drupal Core 8.4+.

Namespace

Drupal\scheduler\Commands

Code

public function cron(array $options = [
  'nomsg' => NULL,
  'nolog' => NULL,
]) {
  $this->schedulerManager
    ->runLightweightCron($options);
  $options['nomsg'] ? NULL : $this->messenger
    ->addMessage(dt('Scheduler lightweight cron completed.'));
}