You are here

function civicrm_cron_cron in CiviCRM Cron 7.2

Same name and namespace in other branches
  1. 8 civicrm_cron.module \civicrm_cron_cron()
  2. 6 civicrm_cron.module \civicrm_cron_cron()
  3. 7 civicrm_cron.module \civicrm_cron_cron()

Implementation of hook_cron().

File

./civicrm_cron.module, line 125
CiviCRM Cron Module

Code

function civicrm_cron_cron() {
  global $base_url;
  $key = variable_get('civicrm_cron_sitekey', NULL);

  // we use drupal_http_request because any errors from
  // $facility->execute() are printed to screen
  $result = drupal_http_request($base_url . 'civicrm-cron/passthrough?key=' . $key);

  //look for the CiviCRM error in response... successful processing returns nothing
  if (!empty($result->data)) {
    watchdog('civirm_cron', $result->data, NULL, WATCHDOG_ERROR);
  }
  else {
    watchdog('civirm_cron', t('CiviCRM Cron: Successfully Run'), NULL, WATCHDOG_NOTICE);
  }
}