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

feature: add profiles to in mem #4441

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feature: add profiles to in mem #4441

wants to merge 3 commits into from

Conversation

akshay-97
Copy link
Contributor

@akshay-97 akshay-97 commented Apr 23, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

add business profile to in mem cache

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

add business profile to in mem cache, so that repeated reads from application doesnt go to db

How did you test it?

try /payments create and check server logs for select query for business_profile
DEBUG diesel_models::query::generics: query: SELECT "business_profile"."profile_id", "business_profile"."merchant_id", "business_profile"."profile_name", "business_profile"."created_at", "business_profile"."modified_at", "business_profile"."return_url", "business_profile"."enable_payment_response_hash", "business_profile"."payment_response_hash_key", "business_profile"."redirect_to_merchant_with_http_post", "business_profile"."webhook_details", "business_profile"."metadata", "business_profile"."routing_algorithm", "business_profile"."intent_fulfillment_time", "business_profile"."frm_routing_algorithm", "business_profile"."payout_routing_algorithm", "business_profile"."is_recon_enabled", "business_profile"."applepay_verified_domains", "business_profile"."payment_link_config", "business_profile"."session_expiry", "business_profile"."authentication_connector_details" FROM "business_profile" WHERE ("business_profile"."profile_id" = $1) -- binds: ["***"]

hit payments create again, logs shouldnt be showing select query for business profile

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@akshay-97 akshay-97 self-assigned this Apr 23, 2024
@akshay-97 akshay-97 requested a review from a team as a code owner April 23, 2024 09:55
#[cfg(feature = "accounts_cache")]
{
let business_profile = self.find_business_profile_by_profile_id(profile_id).await?;
let result: bool = db_func().await?;
Copy link
Member

Choose a reason for hiding this comment

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

We should delete it from cache first and then delete from db

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants