CronService.php in Acquia Connector 8
File
src/CronService.php
View source
<?php
namespace Drupal\acquia_connector;
use Drupal\Core\Logger\RfcLoggerTrait;
use Psr\Log\LoggerInterface;
class CronService implements LoggerInterface {
use RfcLoggerTrait;
public function log($level, $message, array $context = []) {
if (!empty($context['channel']) && $context['channel'] == 'cron' && $message == 'Attempting to re-run cron while it is already running.') {
$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();
}
}
}
}