Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Duplicate
-
Affects Version/s: 4.2.2, 4.3.1
-
Fix Version/s: None
-
Component/s: CiviMail
-
Labels:None
Description
After scheduling a mailing, on the first run triggered by a cron only 10 emails get sent.
I've investigated and figured out the problem is that the status for the mailing is getting cached and then later code is looking at the cached version instead of the updated version.
In more detail:
CRM_Core_DAO::getFieldValue uses a cached value by default, so an earlier call call to this function for the mailing status cached the value 'Scheduled', but really the current status is 'Running'. Then when there is a check to see if the job has been cancelled (i.e. no longer 'Running') the check sees the cached 'Scheduled' value and so thinks the job has been cancelled. So we should not use the cached value when deciding whether we should exit early.
I've included a patch against 4.2.2.