Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/313130
Change subject: WIP use redis for Adyen jobs ...................................................................... WIP use redis for Adyen jobs Hmm, looks like this pushing not-arrays actually works for paypal. Change-Id: I457c8940cdbc476fad8691ccf3ec17426c75f524 --- M PaymentProviders/Adyen/Actions/CaptureResponseAction.php M PaymentProviders/Adyen/Actions/PaymentCaptureAction.php M PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php M SmashPig.yaml 4 files changed, 13 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/30/313130/1 diff --git a/PaymentProviders/Adyen/Actions/CaptureResponseAction.php b/PaymentProviders/Adyen/Actions/CaptureResponseAction.php index ffc9f3c..2dae705 100644 --- a/PaymentProviders/Adyen/Actions/CaptureResponseAction.php +++ b/PaymentProviders/Adyen/Actions/CaptureResponseAction.php @@ -22,8 +22,8 @@ "Adding record capture job for {$msg->currency} {$msg->amount} with id {$msg->correlationId} and psp reference {$msg->pspReference}." ); $recordJob = RecordCaptureJob::factory( $msg ); - $jobQueue = QueueFactory::getQueue( 'jobs' ); - $jobQueue->addObject( $recordJob ); + $jobQueue = QueueFactory::getQueue( 'jobs-adyen' ); + $jobQueue->push( $recordJob ); } else { $tl->warning( "Capture failed for payment with reference {$msg->pspReference} and correlation id {$msg->correlationId}.", diff --git a/PaymentProviders/Adyen/Actions/PaymentCaptureAction.php b/PaymentProviders/Adyen/Actions/PaymentCaptureAction.php index 943575e..25e7a1c 100644 --- a/PaymentProviders/Adyen/Actions/PaymentCaptureAction.php +++ b/PaymentProviders/Adyen/Actions/PaymentCaptureAction.php @@ -18,7 +18,7 @@ $tl = new TaggedLogger( 'PaymentCaptureAction' ); if ( $msg instanceof Authorisation ) { - $jobQueueObj = QueueFactory::getQueue( 'jobs' ); + $jobQueueObj = QueueFactory::getQueue( 'jobs-adyen' ); if ( $msg->success ) { // Here we need to capture the payment, the job runner will collect the // orphan message @@ -26,7 +26,7 @@ "Adding Adyen capture job for {$msg->currency} {$msg->amount} " . "with id {$msg->correlationId} and psp reference {$msg->pspReference}." ); - $jobQueueObj->addObject( + $jobQueueObj->push( ProcessCaptureRequestJob::factory( $msg ) ); @@ -37,7 +37,7 @@ "reported status failed: '{$msg->reason}'. " . 'Queueing job to delete pending records.' ); - $jobQueueObj->addObject( + $jobQueueObj->push( DeletePendingJob::factory( 'adyen', $msg->merchantReference, diff --git a/PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php b/PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php index b0ac3d0..80ac7d3 100644 --- a/PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php +++ b/PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php @@ -20,9 +20,9 @@ $this->reason ); - $jobQueueObj = QueueFactory::getQueue( 'jobs' ); + $jobQueueObj = QueueFactory::getQueue( 'jobs-adyen' ); if ( strpos( $this->pspReference, 'settlement_detail_report' ) === 0 ) { - $jobQueueObj->addObject( + $jobQueueObj->push( DownloadReportJob::factory( $this->merchantAccountCode, $this->reason diff --git a/SmashPig.yaml b/SmashPig.yaml index fb65a57..0f5a8e8 100644 --- a/SmashPig.yaml +++ b/SmashPig.yaml @@ -98,6 +98,12 @@ - <<: *REDIS + jobs-adyen: + class: PHPQueue\Backend\Predis + constructor-parameters: + - + <<: *REDIS + verified: class: SmashPig\Core\DataStores\MultiQueueWriter constructor-parameters: -- To view, visit https://gerrit.wikimedia.org/r/313130 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I457c8940cdbc476fad8691ccf3ec17426c75f524 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: Ejegg <eeggles...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits