ActiveRecord in Rails 5.2 discards connection pools after fork.
This commit is contained in:
parent
8d92c73aad
commit
805fd17b23
|
@ -205,10 +205,6 @@ before_fork do |server, worker|
|
|||
|
||||
end
|
||||
|
||||
RailsMultisite::ConnectionManagement.each_connection do
|
||||
ActiveRecord::Base.connection_pool.disconnect!
|
||||
end
|
||||
|
||||
$redis._client.disconnect
|
||||
|
||||
# Throttle the master from forking too quickly by sleeping. Due
|
||||
|
|
|
@ -436,8 +436,6 @@ module Discourse
|
|||
# in a bad state
|
||||
def self.after_fork
|
||||
# note: all this reconnecting may no longer be needed per https://github.com/redis/redis-rb/pull/414
|
||||
current_db = RailsMultisite::ConnectionManagement.current_db
|
||||
RailsMultisite::ConnectionManagement.establish_connection(db: current_db)
|
||||
MessageBus.after_fork
|
||||
SiteSetting.after_fork
|
||||
$redis._client.reconnect
|
||||
|
|
Loading…
Reference in New Issue