Skip to content

Commit

Permalink
Dev/Core 25 Wrap the mailing split_job function in a transaction to e…
Browse files Browse the repository at this point in the history
…nsure that there is no possibility of duplicate maiing jobs created

Include the split_jobs in the transaction used to update the parent job
  • Loading branch information
seamuslee001 committed Mar 22, 2018
1 parent 22b09a4 commit 2cf4876
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CRM/Mailing/BAO/MailingJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,11 @@ public static function runJobs_pre($offset = 200, $mode = NULL) {
continue;
}

$transaction = new CRM_Core_Transaction();

$job->split_job($offset);

// update the status of the parent job
$transaction = new CRM_Core_Transaction();

$saveJob = new CRM_Mailing_DAO_MailingJob();
$saveJob->id = $job->id;
$saveJob->start_date = date('YmdHis');
Expand Down Expand Up @@ -437,6 +437,7 @@ public function split_job($offset = 200) {
CRM_Core_DAO::executeQuery($sql, $params);
}
}

}

/**
Expand Down

0 comments on commit 2cf4876

Please sign in to comment.