CronOverride.php in Automatic Updates 8
File
src/EventSubscriber/CronOverride.php
View source
<?php
namespace Drupal\automatic_updates\EventSubscriber;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Config\ConfigFactoryOverrideInterface;
use Drupal\Core\Config\StorageInterface;
class CronOverride implements ConfigFactoryOverrideInterface {
const WARNING_THRESHOLD = 10800;
const ERROR_THRESHOLD = 21600;
public function loadOverrides($names) {
$overrides = [];
if (in_array('system.cron', $names, TRUE)) {
$overrides['system.cron']['threshold'] = [
'requirements_warning' => $this::WARNING_THRESHOLD,
'requirements_error' => $this::ERROR_THRESHOLD,
];
}
return $overrides;
}
public function getCacheSuffix() {
return 'CronOverride';
}
public function getCacheableMetadata($name) {
return new CacheableMetadata();
}
public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
return NULL;
}
}
Classes
Name |
Description |
CronOverride |
This class overrides the default system warning and error limits for cron. |