-
Notifications
You must be signed in to change notification settings - Fork 14
In-Memory Caching Implementation #709
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
Conversation
| public void RemoveStreetcodeCaches(int streetcodeId) | ||
| { | ||
| string cacheKeyImage = $"ImageCache_{streetcodeId}"; | ||
| string cacheKeyText = $"TextCache_{streetcodeId}"; | ||
|
|
||
| _cache.Remove(cacheKeyImage); | ||
| _cache.Remove(cacheKeyText); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's implement here the generic Remove method, this method shouldn't know anything about the method where it will be used.
| } | ||
|
|
||
| return Result.Ok(imageDtos); | ||
| string cacheKey = $"ImageCache_{request.StreetcodeId}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this cache keys to some standardized solution, we shouldn't hardcode this key here and in every method we need this
| public async Task<Result<TextDTO?>> Handle(GetTextByStreetcodeIdQuery request, CancellationToken cancellationToken) | ||
| { | ||
| var text = await _repositoryWrapper.TextRepository | ||
| string cacheKey = $"TextCache_{request.StreetcodeId}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same code smell here
|
SonarCloud Quality Gate failed.
|











dev
JIRA
Code reviewers
Second Level Review
Summary of issue
ToDo
Summary of change
ToDo
Testing approach
ToDo
CHECK LIST