CronController::runManually

public CronController::runManually()

Run cron manually.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse A Symfony direct response object.

File

core/modules/system/src/CronController.php, line 59

Class

CronController
Controller for Cron handling.

Namespace

Drupal\system

Code

public function runManually() {
  if ($this->cron->run()) {
    drupal_set_message($this->t('Cron ran successfully.'));
  }
  else {
    drupal_set_message($this->t('Cron run failed.'), 'error');
  }

  return $this->redirect('system.status');
}
doc_Drupal
2016-10-29 08:59:08
Comments
Leave a Comment

Please login to continue.