Skip to content
Snippets Groups Projects
Commit 28b5b359 authored by Ted Bowman's avatar Ted Bowman
Browse files

Revert "Issue #3248544 by tedbow, kunal.sachdev: Build in some buffer time...

Revert "Issue #3248544 by tedbow, kunal.sachdev: Build in some buffer time when validating cron frequency based on last run time"

This reverts commit 2380f18d.
parent 2380f18d
No related branches found
No related tags found
No related merge requests found
...@@ -171,12 +171,12 @@ class CronFrequencyValidator implements EventSubscriberInterface { ...@@ -171,12 +171,12 @@ class CronFrequencyValidator implements EventSubscriberInterface {
// installed, defaulting to the beginning of the Unix epoch. // installed, defaulting to the beginning of the Unix epoch.
$cron_last = $this->state->get('system.cron_last', $this->state->get('install_time', 0)); $cron_last = $this->state->get('system.cron_last', $this->state->get('install_time', 0));
// Since 'system.cron_last' is not set until the end of the cron run, allow // @todo Should we allow a little extra time in case the server job takes
// a little extra time (600 seconds) in case one cron run takes longer than // longer than expected? Otherwise a server setup with a 3-hour cron job
// the previous cron run. This could result in the value of // will always give this warning. Maybe this isn't necessary because the
// 'system.cron_last' being older than `WARNING_INTERVAL` even if the cron // last cron run time is recorded after cron runs. Address this in
// frequency is exactly the same as `WARNING_INTERVAL`. // https://www.drupal.org/project/automatic_updates/issues/3248544.
if ($this->time->getRequestTime() - $cron_last > (static::WARNING_INTERVAL + 600)) { if ($this->time->getRequestTime() - $cron_last > static::WARNING_INTERVAL) {
$event->addError([ $event->addError([
$this->t('Cron has not run recently. For more information, see the online handbook entry for <a href=":cron-handbook">configuring cron jobs</a> to run at least every @frequency hours.', [ $this->t('Cron has not run recently. For more information, see the online handbook entry for <a href=":cron-handbook">configuring cron jobs</a> to run at least every @frequency hours.', [
':cron-handbook' => 'https://www.drupal.org/cron', ':cron-handbook' => 'https://www.drupal.org/cron',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment