r107593 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107592‎ | r107593 | r107594 >
Date:20:34, 29 December 2011
Author:khorn
Status:ok
Tags:
Comment:
Tweaked the redundancy a little to avoid processing a trickle in realtime, and added more time limit checks in the main prohan processing.
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php (modified) (history)

Diff [purge]

Index: trunk/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

Follow-up revisions

RevisionCommit summaryAuthorDate
r107594followup r107593...khorn20:37, 29 December 2011
r107597MFT r107593, r107594khorn20:47, 29 December 2011

Status & tagging log