From 35a497dc2960cf6b46b7c47853f095326123490c Mon Sep 17 00:00:00 2001 From: Jon Moss Date: Sun, 25 Sep 2016 17:04:21 -0400 Subject: [PATCH] Move behavior to Server::Base, and flush pubsub --- actioncable/lib/action_cable/engine.rb | 1 - actioncable/lib/action_cable/server/base.rb | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/actioncable/lib/action_cable/engine.rb b/actioncable/lib/action_cable/engine.rb index 77c358b640..4c5c975cd8 100644 --- a/actioncable/lib/action_cable/engine.rb +++ b/actioncable/lib/action_cable/engine.rb @@ -70,7 +70,6 @@ module ActionCable app.reloader.before_class_unload do ActionCable.server.restart - ActionCable.server.pubsub.shutdown end end end diff --git a/actioncable/lib/action_cable/server/base.rb b/actioncable/lib/action_cable/server/base.rb index 67ada7cc2e..419eccd73c 100644 --- a/actioncable/lib/action_cable/server/base.rb +++ b/actioncable/lib/action_cable/server/base.rb @@ -37,9 +37,13 @@ module ActionCable connections.each(&:close) @mutex.synchronize do - worker_pool.halt if @worker_pool - + # Shutdown the worker pool + @worker_pool.halt if @worker_pool @worker_pool = nil + + # Shutdown the pub/sub adapter + @pubsub.shutdown if @pubsub + @pubsub = nil end end