Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php |
— | — | @@ -61,13 +61,13 @@ |
62 | 62 | //first, we need to... clean up the limbo queue. |
63 | 63 | |
64 | 64 | //building in some redundancy here. |
65 | | - $keepGoing = true; |
| 65 | + $collider_keepGoing = true; |
66 | 66 | $am_called_count = 0; |
67 | | - while ( $keepGoing ){ |
| 67 | + while ( $collider_keepGoing ){ |
68 | 68 | $antimessageCount = $this->handleStompAntiMessages(); |
69 | 69 | $am_called_count += 1; |
70 | | - if ( $antimessageCount === 0 ){ |
71 | | - $keepGoing = false; |
| 70 | + if ( $antimessageCount < 10 ){ |
| 71 | + $collider_keepGoing = false; |
72 | 72 | } else { |
73 | 73 | sleep(2); //two seconds. |
74 | 74 | } |
— | — | @@ -81,15 +81,19 @@ |
82 | 82 | //..do stuff. |
83 | 83 | foreach ( $orphans as $correlation_id => $orphan ) { |
84 | 84 | //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 | + } |
90 | 92 | } |
91 | 93 | } |
92 | 94 | $this->addStompCorrelationIDToAckBucket( false, true ); //ack all outstanding. |
93 | | - $orphans = $this->getStompOrphans(); |
| 95 | + if ( $this->keepGoing() ){ |
| 96 | + $orphans = $this->getStompOrphans(); |
| 97 | + } |
94 | 98 | } |
95 | 99 | } |
96 | 100 | |
— | — | @@ -163,7 +167,7 @@ |
164 | 168 | $selector = "antimessage = 'true'"; |
165 | 169 | $antimessages = stompFetchMessages( 'cc-limbo', $selector, 1000 ); |
166 | 170 | $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. |
168 | 172 | $count += count( $antimessages ); |
169 | 173 | foreach ( $antimessages as $message ){ |
170 | 174 | //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 |
171 | 175 | Merged /trunk/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php:r107593-107594 |