You are here

function _mailchimp_cron_batch in Mailchimp 8

Same name and namespace in other branches
  1. 6.2 mailchimp.drush.inc \_mailchimp_cron_batch()
  2. 7.5 includes/mailchimp.drush.inc \_mailchimp_cron_batch()
  3. 7 mailchimp.drush.inc \_mailchimp_cron_batch()
  4. 7.2 includes/mailchimp.drush.inc \_mailchimp_cron_batch()
  5. 7.3 includes/mailchimp.drush.inc \_mailchimp_cron_batch()
  6. 7.4 includes/mailchimp.drush.inc \_mailchimp_cron_batch()

Callback function to run cron.

@int null $temp_batchsize

1 string reference to '_mailchimp_cron_batch'
mailchimp_drush_command in includes/mailchimp.drush.inc
Implements hook_drush_command().

File

includes/mailchimp.drush.inc, line 31
Mailchimp Module Drush integration.

Code

function _mailchimp_cron_batch($temp_batchsize = NULL) {
  $stored_batchsize = NULL;
  $config = \Drupal::config('mailchimp.settings');
  if (!is_null($temp_batchsize)) {
    $stored_batchsize = $config
      ->get('batch_limit', 100);
    $config
      ->set('batch_limit', $temp_batchsize);
  }
  mailchimp_cron();
  if (!is_null($stored_batchsize)) {
    $config
      ->get('batch_limit', $stored_batchsize);
  }
}