Fix connection reloading in development mode. [#4929 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
c0fc084e93
commit
62c4e4d385
|
@ -144,7 +144,9 @@ module ActiveRecord
|
|||
@connections.each do |conn|
|
||||
conn.disconnect! if conn.requires_reloading?
|
||||
end
|
||||
@connections = []
|
||||
@connections.delete_if do |conn|
|
||||
conn.requires_reloading?
|
||||
end
|
||||
end
|
||||
|
||||
# Verify active connections and remove and disconnect connections
|
||||
|
|
|
@ -142,9 +142,10 @@ module ActiveRecord
|
|||
# this should be overridden by concrete adapters
|
||||
end
|
||||
|
||||
# Returns true if its safe to reload the connection between requests for development mode.
|
||||
# Returns true if its required to reload the connection between requests for development mode.
|
||||
# This is not the case for Ruby/MySQL and it's not necessary for any adapters except SQLite.
|
||||
def requires_reloading?
|
||||
true
|
||||
false
|
||||
end
|
||||
|
||||
# Checks whether the connection to the database is still active (i.e. not stale).
|
||||
|
|
Loading…
Reference in New Issue