mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Avoid retrieving connection in ActiveRecord::QueryCache multiple times.
This commit is contained in:
parent
2f716694f2
commit
a93c3847ac
1 changed files with 3 additions and 2 deletions
|
@ -29,9 +29,10 @@ module ActiveRecord
|
|||
end
|
||||
|
||||
def call(env)
|
||||
enabled = ActiveRecord::Base.connection.query_cache_enabled
|
||||
connection = ActiveRecord::Base.connection
|
||||
enabled = connection.query_cache_enabled
|
||||
connection_id = ActiveRecord::Base.connection_id
|
||||
ActiveRecord::Base.connection.enable_query_cache!
|
||||
connection.enable_query_cache!
|
||||
|
||||
response = @app.call(env)
|
||||
response[2] = Rack::BodyProxy.new(response[2]) do
|
||||
|
|
Loading…
Reference in a new issue