You are here

function salesforce_pull_check_throttle in Salesforce Suite 7.3

Determines if the Salesforce pull should be allowed, or throttled.

Prevents too many pull processes from running at once.

Return value

bool Returns false if the time elapsed between recent pulls is too short.

1 call to salesforce_pull_check_throttle()
salesforce_pull in modules/salesforce_pull/salesforce_pull.module
Callback for the standard pull process used by webhooks and cron.

File

modules/salesforce_pull/salesforce_pull.module, line 206
Pull updates from Salesforce when a Salesforce object is updated.

Code

function salesforce_pull_check_throttle() {
  $pull_throttle = variable_get('salesforce_pull_throttle', 5);
  $last_sync = variable_get('salesforce_pull_last_sync', 0);
  if (REQUEST_TIME > $last_sync + $pull_throttle) {
    return TRUE;
  }
  return FALSE;
}