r107597 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107596‎ | r107597 | r107598 >
Date:20:47, 29 December 2011
Author:khorn
Status:deferred
Tags:
Comment:
Modified paths:
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php (modified) (history)

Diff [purge]

Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php
@@ -61,13 +61,13 @@
6262 //first, we need to... clean up the limbo queue.
6363
6464 //building in some redundancy here.
65 - $keepGoing = true;
 65+ $collider_keepGoing = true;
6666 $am_called_count = 0;
67 - while ( $keepGoing ){
 67+ while ( $collider_keepGoing ){
6868 $antimessageCount = $this->handleStompAntiMessages();
6969 $am_called_count += 1;
70 - if ( $antimessageCount === 0 ){
71 - $keepGoing = false;
 70+ if ( $antimessageCount < 10 ){
 71+ $collider_keepGoing = false;
7272 } else {
7373 sleep(2); //two seconds.
7474 }
@@ -81,15 +81,19 @@
8282 //..do stuff.
8383 foreach ( $orphans as $correlation_id => $orphan ) {
8484 //process
85 - if ( $this->rectifyOrphan( $orphan ) ){
86 - $this->addStompCorrelationIDToAckBucket( $correlation_id );
87 - $this->handled_ids[$correlation_id] = 'rectified';
88 - } else {
89 - $this->handled_ids[$correlation_id] = 'error';
 85+ if ( $this->keepGoing() ){
 86+ if ( $this->rectifyOrphan( $orphan ) ){
 87+ $this->addStompCorrelationIDToAckBucket( $correlation_id );
 88+ $this->handled_ids[$correlation_id] = 'rectified';
 89+ } else {
 90+ $this->handled_ids[$correlation_id] = 'error';
 91+ }
9092 }
9193 }
9294 $this->addStompCorrelationIDToAckBucket( false, true ); //ack all outstanding.
93 - $orphans = $this->getStompOrphans();
 95+ if ( $this->keepGoing() ){
 96+ $orphans = $this->getStompOrphans();
 97+ }
9498 }
9599 }
96100
@@ -163,7 +167,7 @@
164168 $selector = "antimessage = 'true'";
165169 $antimessages = stompFetchMessages( 'cc-limbo', $selector, 1000 );
166170 $count = 0;
167 - while ( count( $antimessages ) && $this->keepGoing() ){ //if there's an antimessage, we can ack 'em all right now.
 171+ while ( count( $antimessages ) > 10 && $this->keepGoing() ){ //if there's an antimessage, we can ack 'em all right now.
168172 $count += count( $antimessages );
169173 foreach ( $antimessages as $message ){
170174 //add the correlation ID to the ack bucket.
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php
___________________________________________________________________
Modified: svn:mergeinfo
171175 Merged /trunk/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php:r107593-107594

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r107593Tweaked the redundancy a little to avoid processing a trickle in realtime, an...khorn20:34, 29 December 2011
r107594followup r107593...khorn20:37, 29 December 2011

Status & tagging log