Adamw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/74558


Change subject: Job recipients are processed in FIFO order
......................................................................

Job recipients are processed in FIFO order

Change-Id: Ie3a57666004199f63266fd4db0c20a922723368c
---
M sites/all/modules/wmf_common/wmf_communication/Recipient.php
M sites/all/modules/wmf_common/wmf_communication/wmf_communication.install
2 files changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/58/74558/1

diff --git a/sites/all/modules/wmf_common/wmf_communication/Recipient.php 
b/sites/all/modules/wmf_common/wmf_communication/Recipient.php
index 359f2af..bb5ff91 100644
--- a/sites/all/modules/wmf_common/wmf_communication/Recipient.php
+++ b/sites/all/modules/wmf_common/wmf_communication/Recipient.php
@@ -26,6 +26,7 @@
             ->fields( 'wmf_communication_recipient' )
             ->condition( 'job_id', $jobId )
             ->condition( 'status', 'queued' )
+            ->orderBy( 'queued_id' )
             ->range( 0, $batchSize )
             ->execute();
 
diff --git 
a/sites/all/modules/wmf_common/wmf_communication/wmf_communication.install 
b/sites/all/modules/wmf_common/wmf_communication/wmf_communication.install
index 7373452..a4aefca 100644
--- a/sites/all/modules/wmf_common/wmf_communication/wmf_communication.install
+++ b/sites/all/modules/wmf_common/wmf_communication/wmf_communication.install
@@ -25,6 +25,11 @@
     $schema['wmf_communication_recipient'] = array(
         'description' => 'Record linking contact and mail job',
         'fields' => array(
+            'queued_id' => array(
+                'type' => 'serial',
+                'unsigned' => true,
+                'not null' => true,
+            ),
             'contact_id' => array(
                 'description' => 'Foreign key to civicrm.civicrm_contact',
                 'type' => 'int',
@@ -45,6 +50,7 @@
                 'type' => 'text',
             ),
         ),
+        'primary key' => array('queued_id'),
         'indexes' => array(
             'recipient_status' => array('status'),
             'recipient_job' => array('job_id'),

-- 
To view, visit https://gerrit.wikimedia.org/r/74558
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3a57666004199f63266fd4db0c20a922723368c
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Adamw <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to