fix: fix bugs found when testing drainer (#512)

This commit is contained in:
Nishant Joshi
2023-02-07 16:48:41 +05:30
committed by GitHub
parent 2e98670aa7
commit 8205b2278d
3 changed files with 14 additions and 11 deletions

View File

@ -454,7 +454,7 @@ mod storage {
enums::MerchantStorageScheme::RedisKv => {
let key = format!("{}_{}", this.merchant_id, this.payment_id);
let old_connector_transaction_id = &this.connector_transaction_id;
let updated_attempt = payment_attempt.clone().apply_changeset(this.clone());
// Check for database presence as well Maybe use a read replica here ?
let redis_value = serde_json::to_string(&updated_attempt)
@ -470,9 +470,10 @@ mod storage {
let conn = pg_connection(&self.master_pool).await;
// Reverse lookup for connector_transaction_id
if let Some(ref connector_transaction_id) =
updated_attempt.connector_transaction_id
{
if let (None, Some(connector_transaction_id)) = (
old_connector_transaction_id,
&updated_attempt.connector_transaction_id,
) {
let field = format!("pa_{}", updated_attempt.attempt_id);
ReverseLookupNew {
lookup_id: format!(