From: JKingsnorth Date: Thu, 26 Nov 2015 15:45:43 +0000 (+0000) Subject: CRM-17626 Move BULK_MAIL_INSERT_COUNT X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=dfb542fc9d0936dbf62c4d04fa743a122436dd02;p=civicrm-core.git CRM-17626 Move BULK_MAIL_INSERT_COUNT --- diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 335a3fd50c..2f268a5265 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -54,10 +54,6 @@ class CRM_Core_DAO extends DB_DataObject { VALUE_SEPARATOR = "", BULK_INSERT_COUNT = 200, BULK_INSERT_HIGH_COUNT = 200, - // special value for mail bulk inserts to avoid - // potential duplication, assuming a smaller number reduces number of queries - // by some factor, so some tradeoff. CRM-8678 - BULK_MAIL_INSERT_COUNT = 10, QUERY_FORMAT_WILDCARD = 1, QUERY_FORMAT_NO_QUOTES = 2; diff --git a/CRM/Mailing/BAO/MailingJob.php b/CRM/Mailing/BAO/MailingJob.php index 998e046a61..9a9bf55e11 100644 --- a/CRM/Mailing/BAO/MailingJob.php +++ b/CRM/Mailing/BAO/MailingJob.php @@ -454,7 +454,7 @@ VALUES (%1, %2, %3, %4, %5, %6, %7) $recipients->phone_id, ); $count++; - if ($count % CRM_Core_DAO::BULK_MAIL_INSERT_COUNT == 0) { + if ($count % CRM_Mailing_Config::BULK_MAIL_INSERT_COUNT == 0) { CRM_Mailing_Event_BAO_Queue::bulkCreate($params, $now); $count = 0; $params = array(); @@ -757,7 +757,7 @@ VALUES (%1, %2, %3, %4, %5, %6, %7) $targetParams[] = $field['contact_id']; $count++; - if ($count % CRM_Core_DAO::BULK_MAIL_INSERT_COUNT == 0) { + if ($count % CRM_Mailing_Config::BULK_MAIL_INSERT_COUNT == 0) { $this->writeToDB( $deliveredParams, $targetParams, diff --git a/CRM/Mailing/Config.php b/CRM/Mailing/Config.php index 26c6a2ecf7..191a37740e 100644 --- a/CRM/Mailing/Config.php +++ b/CRM/Mailing/Config.php @@ -39,4 +39,9 @@ class CRM_Mailing_Config { const OUTBOUND_OPTION_MOCK = 4; // seems to be the same as 2, but also calls Mail's pre/post hooks? - see packages/Mail const OUTBOUND_OPTION_REDIRECT_TO_DB = 5; + // special value for mail bulk inserts to avoid + // potential duplication, assuming a smaller number reduces number of queries + // by some factor, so some tradeoff. CRM-8678 + const BULK_MAIL_INSERT_COUNT = 10; + }