[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Stop mirroring to stomp from audit processors
jenkins-bot has submitted this change and it was merged. Change subject: Stop mirroring to stomp from audit processors .. Stop mirroring to stomp from audit processors Not sure if those try/catch blocks are right in the GC processor Change-Id: I9f15d622558edd87dc9d74b1dcebd576f66cea08 --- M sites/all/modules/globalcollect_audit/globalcollect_audit.drush.inc M sites/all/modules/globalcollect_audit/globalcollect_audit.module M sites/all/modules/wmf_audit/BaseAuditProcessor.php M sites/all/modules/wmf_audit/adyen/adyen_audit.module M sites/all/modules/wmf_audit/amazon/amazon_audit.module M sites/all/modules/wmf_audit/astropay/astropay_audit.module M sites/all/modules/wmf_audit/wmf_audit.drush.inc M sites/all/modules/wmf_audit/wmf_audit.module 8 files changed, 61 insertions(+), 111 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/globalcollect_audit/globalcollect_audit.drush.inc b/sites/all/modules/globalcollect_audit/globalcollect_audit.drush.inc index f7e55c3..fb0759c 100644 --- a/sites/all/modules/globalcollect_audit/globalcollect_audit.drush.inc +++ b/sites/all/modules/globalcollect_audit/globalcollect_audit.drush.inc @@ -2,7 +2,7 @@ /** * @file globalcollact_audit.drush.inc * Parses .wr1 files from globalcollect and inserts any missing transactions - * into the regular stomp message queue. + * into the regular message queue. * @author Katie Horn * @TODO print some useful info to STDOUT */ @@ -18,13 +18,13 @@ $items['globalcollect-audit'] = array( 'description' => - 'Globalcollect Audit tool: Parses .wr1 files from globalcollect and inserts any missing transactions into the regular stomp message queue.', + 'Globalcollect Audit tool: Parses .wr1 files from globalcollect and inserts any missing transactions into the regular message queues.', 'examples' => array( 'drush globalcollect-audit' => '# Parse the wr1 file', ), 'options' => array( 'run_all' => 'Batch search for all missing transactions across all wr1 files.', -'test' => 'Test the audit scripts, but do not generate stomp messages. No data will be changed.', +'test' => 'Test the audit scripts, but do not generate queue messages. No data will be changed.', 'fakedb' => 'Fake the database information. This will cause the script to avoid looking up the actual contribution id.', 'makemissing' => 'Will reconstruct the un-rebuildable transactions found in the wr1, with default values. USE WITH CAUTION.', 'charlimit' => 'Will cause echoing to line break after the given number of characters', @@ -43,7 +43,7 @@ function globalcollect_audit_drush_help( $section ) { switch ( $section ) { case 'globalcollect-audit': - return dt( "Parses .wr1 files from globalcollect and inserts any missing transactions into the regular stomp message queue." ); + return dt( "Parses .wr1 files from globalcollect and inserts any missing transactions into the regular message queue." ); } } @@ -81,7 +81,7 @@ globalcollect_audit_reset_drush_vars(); if (drush_get_option('test')){ - echo "Running in test mode: No stomp messages will be sent\n"; + echo "Running in test mode: No queue messages will be sent\n"; variable_set( 'globalcollect_audit_test_mode', true ); } if (drush_get_option('fakedb')){ diff --git a/sites/all/modules/globalcollect_audit/globalcollect_audit.module b/sites/all/modules/globalcollect_audit/globalcollect_audit.module index 21bfea6..95aeac9 100644 --- a/sites/all/modules/globalcollect_audit/globalcollect_audit.module +++ b/sites/all/modules/globalcollect_audit/globalcollect_audit.module @@ -1,6 +1,7 @@ 'checkbox', -'#title' => t( 'When this box is checked, no stomp messages will be sent.' ), +'#title' => t( 'When this box is checked, no queue messages will be sent.' ), '#required' => FALSE, '#default_value' => variable_get( 'globalcollect_audit_test_mode', GC_AUDIT_TEST_MODE ), ); @@ -334,7 +335,7 @@ } //This isn't going to work unless you're connecting to a database that has the row you're looking for. - $missing_txn_message = globalcollect_audit_format_data_for_stomp( $data, $logdata['donor_data'], $logdata['contribution_id'] ); + $missing_txn_message = globalcollect_audit_format_data_for_queue( $data, $logdata['donor_data'], $logdata['contribution_id'] ); if ( is_null( $missing_txn_message ) ){ //log this out in a list of troubled transactions. $info = array( @@ -352,14 +353,14 @@ $local_found_ids[] = $order_id;
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Stop mirroring to stomp from audit processors
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/312442 Change subject: Stop mirroring to stomp from audit processors .. Stop mirroring to stomp from audit processors Not sure if those try/catch blocks are right in the GC processor Change-Id: I9f15d622558edd87dc9d74b1dcebd576f66cea08 --- M sites/all/modules/globalcollect_audit/globalcollect_audit.module M sites/all/modules/wmf_audit/wmf_audit.module 2 files changed, 51 insertions(+), 99 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/42/312442/1 diff --git a/sites/all/modules/globalcollect_audit/globalcollect_audit.module b/sites/all/modules/globalcollect_audit/globalcollect_audit.module index 21bfea6..2cb3143 100644 --- a/sites/all/modules/globalcollect_audit/globalcollect_audit.module +++ b/sites/all/modules/globalcollect_audit/globalcollect_audit.module @@ -1,6 +1,7 @@ 'checkbox', -'#title' => t( 'When this box is checked, no stomp messages will be sent.' ), +'#title' => t( 'When this box is checked, no queue messages will be sent.' ), '#required' => FALSE, '#default_value' => variable_get( 'globalcollect_audit_test_mode', GC_AUDIT_TEST_MODE ), ); @@ -334,7 +335,7 @@ } //This isn't going to work unless you're connecting to a database that has the row you're looking for. - $missing_txn_message = globalcollect_audit_format_data_for_stomp( $data, $logdata['donor_data'], $logdata['contribution_id'] ); + $missing_txn_message = globalcollect_audit_format_data_for_queue( $data, $logdata['donor_data'], $logdata['contribution_id'] ); if ( is_null( $missing_txn_message ) ){ //log this out in a list of troubled transactions. $info = array( @@ -352,14 +353,14 @@ $local_found_ids[] = $order_id; globalcollect_audit_echo('!'); } else { - if ( globalcollect_audit_send_queue_message( 'donations', $missing_txn_message ) ){ - watchdog('globalcollect_audit', __FUNCTION__ . ': Message sent to stomp successfully: ' . print_r( $missing_txn_message, true ), array(), WATCHDOG_INFO); + try { + globalcollect_audit_send_queue_message( 'donations', $missing_txn_message ); + watchdog('globalcollect_audit', __FUNCTION__ . ': Message sent to queue successfully: ' . print_r( $missing_txn_message, true ), array(), WATCHDOG_INFO); $local_found_ids[] = $order_id; globalcollect_audit_echo('!'); - } else { - $wd_message = __FUNCTION__ . ': Sending message to stomp failed: ' . print_r( $missing_txn_message, true ); - $drush_message = "Failed sending STOMP message to queue."; - globalcollect_audit_log_error( $wd_message, "STOMP_BAD_SEND", $drush_message ); + } catch( SmashPigException $ex ) { + $wd_message = __FUNCTION__ . ': Sending message to queue failed: ' . print_r( $missing_txn_message, true ); + globalcollect_audit_log_error( $wd_message, "QUEUE_BAD_SEND", $ex->getMessage() ); return; } } @@ -388,21 +389,21 @@ if ( $make_missing && count( $missing ) ){ //make all the remaining missing transactions with data defaults. foreach ( $missing as $order_id => $data ) { - $missing_txn_message = globalcollect_audit_format_data_for_stomp( $data ); + $missing_txn_message = globalcollect_audit_format_data_for_queue( $data ); //but then we have to send the transaction... if ( $test_mode ){ $local_built_ids[] = $order_id; globalcollect_audit_echo('!'); } else { - if ( globalcollect_audit_send_queue_message( 'donations', $missing_txn_message ) ){ - watchdog('globalcollect_audit', __FUNCTION__ . ': Message sent to stomp successfully: ' . print_r( $missing_txn_message, true ), array(), WATCHDOG_INFO); + try{ + globalcollect_audit_send_queue_message( 'donations', $missing_tx