mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Shutdown pubsub connection before classes are reloaded
Before this patch, if you were to make a file edit in your Rails application and you tried to load up the page, it would hang indefinitely. The issue is that Active Record is trying to cleanup after itself and clear all active connection, but Action Cable is still holding onto a connection from the pool. To resolve this, we are now shutting down the pubsub adapter before classes are reloaded, to avoid this altogether (connection is being returned to the pool). Credits to @skateman for discovering this bug. :)
This commit is contained in:
parent
da0fdd6bf5
commit
a5dfba4135
1 changed files with 1 additions and 0 deletions
|
@ -70,6 +70,7 @@ module ActionCable
|
||||||
|
|
||||||
app.reloader.before_class_unload do
|
app.reloader.before_class_unload do
|
||||||
ActionCable.server.restart
|
ActionCable.server.restart
|
||||||
|
ActionCable.server.pubsub.shutdown
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue