class CronOverride in Automatic Updates 8
This class overrides the default system warning and error limits for cron.
It notifies site administrators on a more strict time frame if cron has not recently run.
Hierarchy
- class \Drupal\automatic_updates\EventSubscriber\CronOverride implements ConfigFactoryOverrideInterface
Expanded class hierarchy of CronOverride
2 string references to 'CronOverride'
- automatic_updates.services.yml in ./
automatic_updates.services.yml - automatic_updates.services.yml
- CronOverride::getCacheSuffix in src/
EventSubscriber/ CronOverride.php - The string to append to the configuration static cache name.
1 service uses CronOverride
File
- src/
EventSubscriber/ CronOverride.php, line 15
Namespace
Drupal\automatic_updates\EventSubscriberView source
class CronOverride implements ConfigFactoryOverrideInterface {
/**
* Warn at 3 hours.
*/
const WARNING_THRESHOLD = 10800;
/**
* Error at 6 hours.
*/
const ERROR_THRESHOLD = 21600;
/**
* {@inheritdoc}
*/
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;
}
/**
* {@inheritdoc}
*/
public function getCacheSuffix() {
return 'CronOverride';
}
/**
* {@inheritdoc}
*/
public function getCacheableMetadata($name) {
return new CacheableMetadata();
}
/**
* {@inheritdoc}
*/
public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CronOverride:: |
public | function |
Creates a configuration object for use during install and synchronization. Overrides ConfigFactoryOverrideInterface:: |
|
CronOverride:: |
constant | Error at 6 hours. | ||
CronOverride:: |
public | function |
Gets the cacheability metadata associated with the config factory override. Overrides ConfigFactoryOverrideInterface:: |
|
CronOverride:: |
public | function |
The string to append to the configuration static cache name. Overrides ConfigFactoryOverrideInterface:: |
|
CronOverride:: |
public | function |
Returns config overrides. Overrides ConfigFactoryOverrideInterface:: |
|
CronOverride:: |
constant | Warn at 3 hours. |