Run the automated cron if enabled.
function system_run_automated_cron() {
// If the site is not fully installed, suppress the automated cron run.
// Otherwise it could be triggered prematurely by Ajax requests during
// installation.
if (($threshold = config('system.cron')
->get('threshold.autorun')) > 0 && variable_get('install_task') == 'done') {
$cron_last = state()
->get('system.cron_last') ?: NULL;
if (!isset($cron_last) || REQUEST_TIME - $cron_last > $threshold) {
drupal_cron_run();
}
}
}