function drush_core_cron

8.0.x core.drush.inc drush_core_cron()
6.x core.drush.inc drush_core_cron()
7.x core.drush.inc drush_core_cron()
3.x core.drush.inc drush_core_cron()
4.x core.drush.inc drush_core_cron()
5.x core.drush.inc drush_core_cron()
master core.drush.inc drush_core_cron()

Command callback. Runs all cron hooks.

File

commands/core/core.drush.inc, line 657
Core drush commands.

Code

function drush_core_cron() {
  if (drush_drupal_major_version() < 8) {
    $result = drupal_cron_run();
  }
  else {
    $result = \Drupal::service('cron')->run();
  }
  if ($result) {
    drush_log(dt('Cron run successful.'), LogLevel::SUCCESS);
  }
  else {
    return drush_set_error('DRUSH_CRON_FAILED', dt('Cron run failed.'));
  }
}