Phuks-co / throat

Open Source link aggregator and discussion platform powering Phuks
https://phuks.co
MIT License
73 stars 32 forks source link

Avoid hitting the database to show response times to admins #167

Closed happy-river closed 4 years ago

happy-river commented 4 years ago

If a request doesn't need to load the user, the check for whether the current user is an admin in after_request in order to show the query count and response time was making it load the user anyway. Stop doing this check and log the query count and response times instead.