You are here

function sf_import_cron in Salesforce Suite 6.2

Same name and namespace in other branches
  1. 7.2 sf_import/sf_import.module \sf_import_cron()

Implements hook_cron().

File

sf_import/sf_import.module, line 69

Code

function sf_import_cron() {

  // Make sure we have an active connection to Salesforce
  if ($sf = salesforce_api_connect()) {

    // Get new records from Salesforce since last time cron was run
    if (variable_get('sf_import_cron_import', 1)) {
      sf_import_import_records();
    }

    // Process the records (insert/update records)
    if (variable_get('sf_import_cron_process', 1)) {
      _sf_import_process_records();
    }
  }
}