class CronService in Acquia Connector 8
Same name and namespace in other branches
- 8.2 src/CronService.php \Drupal\acquia_connector\CronService
- 3.x src/CronService.php \Drupal\acquia_connector\CronService
Runs Connector related tasks during Cron.
@package Drupal\acquia_connector
Hierarchy
- class \Drupal\acquia_connector\CronService implements \Psr\Log\LoggerInterface uses RfcLoggerTrait
Expanded class hierarchy of CronService
1 string reference to 'CronService'
1 service uses CronService
File
- src/
CronService.php, line 13
Namespace
Drupal\acquia_connectorView source
class CronService implements LoggerInterface {
use RfcLoggerTrait;
/**
* {@inheritdoc}
*/
public function log($level, $message, array $context = []) {
// Make sure that even when cron failures prevent hook_cron() from being
// called, we still send out a heartbeat.
if (!empty($context['channel']) && $context['channel'] == 'cron' && $message == 'Attempting to re-run cron while it is already running.') {
// Avoid doing this too frequently.
$last_update_attempt = \Drupal::state()
->get('acquia_subscription_data.timestamp', FALSE);
if (!$last_update_attempt || \Drupal::time()
->getRequestTime() - $last_update_attempt >= 60 * 60) {
$subscription = new Subscription();
$subscription
->update();
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CronService:: |
public | function |
Logs with an arbitrary level. Overrides RfcLoggerTrait:: |
|
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function |