You are here

civicrm_cron.module in CiviCRM Cron 8

Same filename and directory in other branches
  1. 6 civicrm_cron.module
  2. 7.2 civicrm_cron.module
  3. 7 civicrm_cron.module

CiviCRM Cron Module.

File

civicrm_cron.module
View source
<?php

/**
 * @file
 * CiviCRM Cron Module.
 */

/**
 * Implements hook_cron().
 */
function civicrm_cron_cron() {

  /** @var \Drupal\civicrm_cron\CronRunner $runner */
  $runner = \Drupal::service('civicrm_cron.cron_runner');

  /** @var \Psr\Log\LoggerInterface $logger */
  $logger = \Drupal::logger('civicrm_cron');
  try {
    $runner
      ->runCron();
    $logger
      ->notice(t('CiviCRM Cron: Successfully Run'));
  } catch (\Exception $e) {
    $logger
      ->error(t('CiviCRM Cron:') . ' ' . $e
      ->getMessage());
  }
}

Functions

Namesort descending Description
civicrm_cron_cron Implements hook_cron().