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

perf(update_auth_header): only lock the resource if we are rotating tokens #267

Merged
merged 1 commit into from
Jun 16, 2015
Merged

perf(update_auth_header): only lock the resource if we are rotating tokens #267

merged 1 commit into from
Jun 16, 2015

Conversation

booleanbetrayal
Copy link
Collaborator

@resource.with_lock is causing a transaction which is what we want if we're rotating tokens and are dealing with any potential contention scenarios, but is entirely unnecessary if we're not saving anything and just grabbing the auth headers for the response. This removes an unnecessary transaction overhead from the DB. In real-world terms, we've seen these transactions take anywhere between 3 and 400ms, so there's a chance the savings are worth it for others.

booleanbetrayal added a commit that referenced this pull request Jun 16, 2015
…ssary

perf(update_auth_header): only lock the resource if we are rotating tokens
@booleanbetrayal booleanbetrayal merged commit 1d65f8f into lynndylanhurley:master Jun 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant