You are here

function salesforce_update_8800 in Salesforce Suite 5.0.x

New cache lifetime config options.

File

./salesforce.install, line 463
Salesforce install file.

Code

function salesforce_update_8800() {
  $settings = \Drupal::configFactory()
    ->getEditable('salesforce.settings');
  $save = FALSE;
  if (!$settings
    ->get('short_term_cache_lifetime')) {
    $settings
      ->set('short_term_cache_lifetime', \Drupal\salesforce\Rest\RestClient::CACHE_LIFETIME);
    $save = TRUE;
  }
  if (!$settings
    ->get('long_term_cache_lifetime')) {
    $settings
      ->set('long_term_cache_lifetime', \Drupal\salesforce\Rest\RestClient::LONGTERM_CACHE_LIFETIME);
    $save = TRUE;
  }
  $settings
    ->save();
}