Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(payment_attempt): add kv for find last successful attempt #2206

Merged
merged 5 commits into from
Sep 25, 2023

Conversation

dracarys18
Copy link
Member

Type of Change

  • Enhancement

Description

Add KV for last successful payment attempt

Motivation and Context

Add it in KV for better latency

How did you test it?

This function is being used in refunds_create_core. So refund should succeed.

Screenshot 2023-09-20 at 3 06 54 PM Screenshot 2023-09-20 at 3 07 15 PM

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code

@dracarys18 dracarys18 requested a review from a team as a code owner September 20, 2023 09:39
@dracarys18 dracarys18 self-assigned this Sep 20, 2023
@dracarys18 dracarys18 added A-core Area: Core flows S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Sep 20, 2023
@dracarys18 dracarys18 changed the title feat: add kv for find last successful attempt feat(payment_attempt): add kv for find last successful attempt Sep 20, 2023
crates/storage_impl/src/payments/payment_attempt.rs Outdated Show resolved Hide resolved
@@ -50,7 +50,7 @@ impl<T: DatabaseStore> ReverseLookupInterface for RouterStore<T> {
er.change_context(new_err)
})
};
get_or_populate_redis(self, id, database_call).await
get_or_populate_redis(self, format!("reverse_lookup_{id}"), database_call).await
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In all reverse lookup are we adding prefix as reverse_lookup_?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah because this doesn't have shard key so it needs a prefix to avoid key clashing.

crates/storage_impl/src/payments/payment_attempt.rs Outdated Show resolved Hide resolved
crates/storage_impl/src/payments/payment_attempt.rs Outdated Show resolved Hide resolved
jarnura
jarnura previously approved these changes Sep 21, 2023
@jarnura jarnura added this pull request to the merge queue Sep 25, 2023
Merged via the queue into main with commit d3157f0 Sep 25, 2023
9 of 10 checks passed
@jarnura jarnura deleted the kv_for_payment_attempt branch September 25, 2023 11:06
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants