Add endpoint to get CautionaryAlerts from database#30
Merged
Conversation
Asura5
reviewed
Mar 21, 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.
Describe this PR
What is the problem we're trying to solve
When loading cautionary alerts from an endpoint that uses GoogleSheets, it often returns
502 BadGateway. The issue correlates with a large number of requests to the endpoint, which suggests it is related to rate limiting on Google's end.Currently, I cannot find a solution for this, other than reducing the number of requests made to the GoogleSheets API.
What changes have we introduced
This PR introduces a new endpoint GetPropertyAlertsNew and a new table in the UH database.
api/v1/cautionary-alerts/properties-new/{propertyReference}PropertyAlertNewTo mitigate the issue with GoogleSheets, the data from the CautionaryAlerts spreadsheet will be read from a database directly.
The data will be manually imported into the database using a stored procedure.
The endpoint behaves the same as the googleSheets equivalent, other than reading data from a database.
Checklist
Follow up actions after merging PR