scheduler.drush.inc in Scheduler 8
Same filename and directory in other branches
Drush commands for Scheduler.
File
scheduler.drush.incView source
<?php
/**
* @file
* Drush commands for Scheduler.
*/
/**
* Implements hook_drush_command().
*/
function scheduler_drush_command() {
$items = [];
$items['scheduler-cron'] = [
'description' => 'Lightweight cron to process scheduler tasks.',
'core' => [
'8+',
],
'aliases' => [
'sch-cron',
],
'category' => 'scheduler',
'options' => [
'nomsg' => 'to avoid the "cron completed" message being written to the terminal.',
],
];
return $items;
}
/**
* Run lightweight scheduler cron.
*/
function drush_scheduler_cron() {
\Drupal::service('scheduler.manager')
->runLightweightCron();
$nomsg = drush_get_option('nomsg', NULL);
$nomsg ? NULL : \Drupal::messenger()
->addMessage(t('Scheduler lightweight cron completed'));
}
Functions
Name![]() |
Description |
---|---|
drush_scheduler_cron | Run lightweight scheduler cron. |
scheduler_drush_command | Implements hook_drush_command(). |