Skip to content

Conversation

@diox
Copy link
Member

@diox diox commented Feb 28, 2022

When dealing with a request with auth credentials, GraphiteMiddleware's default implementation forces request.user to be evaluated to send a response.auth statsd ping, causing a database query even if the view didn't use auth at all. We don't need that ping, so replace the middleware with a custom one that doesn't do this, avoiding the database query in those cases.

Fixes mozilla/addons#8693

When dealing with a request with auth credentials, GraphiteMiddleware's default implementation forces request.user to be evaluated to send a `response.auth` statsd ping, causing a database query even if the view didn't use auth at all. We don't need that ping, so replace the middleware with a custom one that doesn't do this, avoiding the database query in those cases.
@diox diox requested review from a team and bobsilverberg and removed request for a team February 28, 2022 11:36
@diox diox merged commit 6887de3 into mozilla:master Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants