-
Notifications
You must be signed in to change notification settings - Fork 27
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
Handle database overloads and return 429 #141
base: main
Are you sure you want to change the base?
Conversation
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.
Looks ok to me, except I'm starting to get eyestrain, so you may wish to wait for @giventocode to weigh in.
@@ -0,0 +1,42 @@ | |||
namespace TesApi.Web |
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.
I'd suggest moving this file to the Controllers
folder, since that's the only context in which this code will ever operate.
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.
LGTM!
When the database is overloaded (timeouts, connection pool exhaustion), this PR uses global middleware exception handling to return 429 (too many requests) to the caller. #228