Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CronController.php

function CronController::runManually

Run cron manually.

Return value

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

1 string reference to 'CronController::runManually'
system.routing.yml in core/modules/system/system.routing.yml
core/modules/system/system.routing.yml

File

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

Class

CronController
Controller for Cron handling.

Namespace

Drupal\system

Code

public function runManually() {
    if ($this->cron
        ->run()) {
        $this->messenger()
            ->addStatus($this->t('Cron ran successfully.'));
    }
    else {
        $this->messenger()
            ->addError($this->t('Cron run failed.'));
    }
    return $this->redirect('system.status');
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal