Skip to content
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

Check quota enforcement /before/ initiating database query. #855

Closed
pgulley opened this issue Nov 15, 2024 · 1 comment · Fixed by #856
Closed

Check quota enforcement /before/ initiating database query. #855

pgulley opened this issue Nov 15, 2024 · 1 comment · Fixed by #856
Assignees
Labels
high High priority

Comments

@pgulley
Copy link
Member

pgulley commented Nov 15, 2024

Right now our query quota implementation doesn't bail out of a request until /after/ the potentially costly database operation has been completed! So, although we return 404s when the quota is reached, we don't actually save ourselves any work.

A quick fix would be to just move the increment call up the function to before the request to db is made. A less quick, but more robust fix would be to move the quota logic to a request middleware and manage this all at the same step is other authentication concerns.

@pgulley pgulley added the high High priority label Nov 15, 2024
@pgulley
Copy link
Member Author

pgulley commented Nov 18, 2024

#856 fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high High priority
Projects
None yet
3 participants