get('system.cron_key')) { \Drupal::logger('cron')->notice('Cron could not run because an invalid key was used.'); return static::KILL; } elseif (\Drupal::state()->get('system.maintenance_mode')) { \Drupal::logger('cron')->notice('Cron could not run because the site is in maintenance mode.'); return static::KILL; } return static::ALLOW; } }