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(router): add route to invalidate cache entry #1100

Conversation

jeevaprakashdr
Copy link
Contributor

@jeevaprakashdr jeevaprakashdr commented May 9, 2023

Type of Change

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

Description

A new route to invalidate the in-memory cache and redis

Additional Changes

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

Motivation and Context

Currently we don't have any way to manually invalidate cache that's stored in redis and in-memory,

Closes #995.

How did you test it?

A unit test is added to test the in-memory cache and postman script used for redis cache.

Checklist

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

@jeevaprakashdr jeevaprakashdr requested review from a team, jarnura and ashokkjag as code owners May 9, 2023 21:42
@jeevaprakashdr jeevaprakashdr force-pushed the feature_995_add_route_to_invalidate_cache branch 5 times, most recently from ff92f9c to 0850a4f Compare May 9, 2023 22:30
@SanchithHegde SanchithHegde added A-framework Area: Framework C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels May 10, 2023
Copy link
Member

@SanchithHegde SanchithHegde left a comment

Choose a reason for hiding this comment

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

Other than that, looks good to me!

crates/router/src/core/errors/api_error_response.rs Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
crates/router/src/core/cache.rs Outdated Show resolved Hide resolved
crates/router/src/core/cache.rs Outdated Show resolved Hide resolved
crates/router/src/routes/cache.rs Outdated Show resolved Hide resolved
crates/router/tests/cache.rs Show resolved Hide resolved
@SanchithHegde SanchithHegde added S-waiting-on-author Status: This PR is incomplete or needs to address review comments and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels May 10, 2023
@SanchithHegde SanchithHegde changed the title feat(router) : add route to invalidate cache (#995) feat(router): add route to invalidate cache May 10, 2023
@Narayanbhat166 Narayanbhat166 changed the title feat(router): add route to invalidate cache feat(router): add route to invalidate cache entry May 10, 2023
@jeevaprakashdr jeevaprakashdr force-pushed the feature_995_add_route_to_invalidate_cache branch from 2f1974c to f0d6624 Compare May 10, 2023 21:06
jeevaprakashdr and others added 7 commits May 13, 2023 21:32
added remove method to invalidate the cache key
added endpont 
added unit test
refactored route to include route parameters
Added flow type
Added API error response type
Created cache interface for db module
updated unit test: Check if the key/value is invalidated.
remove dthe cache interface
Copy link
Member

@SanchithHegde SanchithHegde left a comment

Choose a reason for hiding this comment

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

Other than that, looks good to me!

crates/drainer/src/utils.rs Outdated Show resolved Hide resolved
SanchithHegde
SanchithHegde previously approved these changes Jun 3, 2023
Copy link
Member

@dracarys18 dracarys18 left a comment

Choose a reason for hiding this comment

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

Other than LGTM

dracarys18
dracarys18 previously approved these changes Jun 13, 2023
SanchithHegde
SanchithHegde previously approved these changes Jun 13, 2023
@SanchithHegde SanchithHegde added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed and removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels Jun 13, 2023
# Conflicts:
#	crates/router_env/src/logger/types.rs
@SanchithHegde SanchithHegde added this pull request to the merge queue Jun 21, 2023
@SanchithHegde SanchithHegde added S-ready-for-merge and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Jun 21, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 21, 2023
@SanchithHegde SanchithHegde added this pull request to the merge queue Jun 21, 2023
Merged via the queue into juspay:main with commit 21f2ccd Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-framework Area: Framework C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] add a route that will invalidate cache
4 participants