Avoid extraneous read for SpMetadataInSession after saving#7644
Merged
mitchellhenke merged 1 commit intomainfrom Jan 17, 2023
Merged
Avoid extraneous read for SpMetadataInSession after saving#7644mitchellhenke merged 1 commit intomainfrom
mitchellhenke merged 1 commit intomainfrom
Conversation
changelog: Internal, Performance, Avoid extraneous read for SpMetadataInSession after saving
0876865 to
e5d1e4c
Compare
zachmargolis
approved these changes
Jan 17, 2023
| ServiceProviderRequestProxy.create!(attributes) | ||
|
|
||
| StoreSpMetadataInSession.new(session: session, request_id: request_id).call | ||
| service_provider_request = ServiceProviderRequestProxy.create!(attributes) |
Contributor
There was a problem hiding this comment.
separate topic, but while we're here: I think that it's probably time to combine ServiceProviderRequest and ServiceProviderRequestProxy. The proxy is leftover from a migration from an AR model to a redis model, and now that we only have the redis one, we could probably simplify
Contributor
Author
There was a problem hiding this comment.
Agree, we can probably pull the classes together since ServiceProviderRequest is basically a struct at this point.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary of changes
StoreSpMetadataInSession#callreads the value written to Redis inServiceProviderRequestProxy.create!(attributes)to put the information in the session.I couldn't find anything that suggested this pattern was necessary since the value returned is the value that was written. To avoid the extra read, this change adds an option to pass the value directly rather than read it from Redis.