Only create sp_return_logs on SP handoff#6141
Merged
mitchellhenke merged 2 commits intomainfrom Apr 1, 2022
Merged
Conversation
changelog: Internal, Optimization, Only create service provider return logs for billable events
322d7bc to
e916b45
Compare
stevegsa
reviewed
Apr 1, 2022
Contributor
|
Excellent! |
stevegsa
approved these changes
Apr 1, 2022
04497d9 to
4d856e7
Compare
zachmargolis
reviewed
Apr 4, 2022
| @@ -70,11 +70,6 @@ | |||
| args: -> { [Time.zone.today] }, | |||
| }, | |||
| # Send Sp Success Rate Report to S3 | |||
Contributor
There was a problem hiding this comment.
should we have dropped this comment line too?
This was referenced Apr 4, 2022
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.
Currently, we create an SpReturnLog when someone arrives from a service provider, and then update the record if and when the person is redirected back to the service provider. This functionality is quite write-heavy since a record is created on every SP authentication and later updated upon SP return. This functionality is primarily for billing, so some care is warranted around changing the behavior.
For billing, users that are not redirected back do not get counted as billable, and after speaking with @stevegsa, my understanding is that the
success_rate_by_spreport is not used heavily.With that in mind, this PR changes the SpReturnLog functionality to only create the SpReturnLog row on the SP return, so that there is only one insert, instead of an insert and an update to help reduce the load on the database.