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

ActiveRecord::LogSubscriber.runtime should be reset at the start of each request #554

Merged

Conversation

tomafro
Copy link
Contributor

@tomafro tomafro commented May 14, 2011

Currently, the runtime isn't reset following a redirect or a send_file, so any time taken to process those actions is added to the time for the subsequent request.

Previously the runtime was reset implicitly when #cleanup_view_runtime was called at the end of most requests. However, this doesn't happen when the request redirects, or send_file is called.  Consequently, the ActiveRecord runtime recorded in the logs included the time taken for both the current request and the previous redirect.  Explicitly resetting at the start of each request ensures that this can't happen, no matter what occurs previously.
josevalim added a commit that referenced this pull request May 14, 2011
…e-each-request

ActiveRecord::LogSubscriber.runtime should be reset at the start of each request
@josevalim josevalim merged commit c4837f6 into rails:master May 14, 2011
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.

None yet

2 participants