Mwalker has submitted this change and it was merged.

Change subject: DUPs should be dropped, not rejected
......................................................................


DUPs should be dropped, not rejected

Change-Id: I633b41c42a794ff2a76b00007fe395d9f097cc65
---
M sites/all/modules/wmf_common/Queue.php
M sites/all/modules/wmf_common/WmfException.php
2 files changed, 10 insertions(+), 2 deletions(-)

Approvals:
  Mwalker: Looks good to me, approved



diff --git a/sites/all/modules/wmf_common/Queue.php 
b/sites/all/modules/wmf_common/Queue.php
index ba21e8b..dac6f65 100644
--- a/sites/all/modules/wmf_common/Queue.php
+++ b/sites/all/modules/wmf_common/Queue.php
@@ -91,7 +91,10 @@
                     }
                 }
 
-                if ( $ex->isRejectMessage() ) {
+                if ( $ex->isDropMessage() ) {
+                    watchdog( 'wmf_common', "Dropping message altogether: " . 
Queue::getCorrelationId( $msg ), NULL, WATCHDOG_ERROR );
+                    $this->ack( $msg );
+                } elseif ( $ex->isRejectMessage() ) {
                     watchdog( 'wmf_common', "\nRemoving failed message from 
the queue: \n" . print_r($msg, TRUE), NULL, WATCHDOG_ERROR );
                     $this->reject( $msg, $ex );
 
diff --git a/sites/all/modules/wmf_common/WmfException.php 
b/sites/all/modules/wmf_common/WmfException.php
index de53bcb..9713bf5 100644
--- a/sites/all/modules/wmf_common/WmfException.php
+++ b/sites/all/modules/wmf_common/WmfException.php
@@ -29,7 +29,7 @@
             'reject' => TRUE,
         ),
         'DUPLICATE_CONTRIBUTION' => array(
-            'reject' => TRUE,
+            'drop' => TRUE,
             'no-email' => TRUE,
         ),
         'GET_CONTRIBUTION' => array(
@@ -107,6 +107,11 @@
         return $this->getErrorCharacteristic('reject', FALSE);
     }
 
+    function isDropMessage()
+    {
+        return $this->getErrorCharacteristic('drop', FALSE);
+    }
+
     function isRequeue()
     {
         return $this->getErrorCharacteristic('requeue', FALSE);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I633b41c42a794ff2a76b00007fe395d9f097cc65
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Adamw <[email protected]>
Gerrit-Reviewer: Katie Horn <[email protected]>
Gerrit-Reviewer: Mwalker <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to