From 52fed6507ff50e52e601f09b72e608139ccffd6c Mon Sep 17 00:00:00 2001 From: Nick Pezza Date: Fri, 6 Dec 2024 10:22:26 -0500 Subject: [PATCH] Move executor --- lib/action_cable/subscription_adapter/solid_cable.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/action_cable/subscription_adapter/solid_cable.rb b/lib/action_cable/subscription_adapter/solid_cable.rb index 65944aa..d63e29c 100644 --- a/lib/action_cable/subscription_adapter/solid_cable.rb +++ b/lib/action_cable/subscription_adapter/solid_cable.rb @@ -45,7 +45,7 @@ def initialize(event_loop) @thread = Thread.new do Thread.current.abort_on_exception = true - listen + Rails.application.executor.wrap { listen } end end @@ -96,12 +96,10 @@ def channels end def broadcast_messages - Rails.application.executor.wrap do - ::SolidCable::Message.broadcastable(channels, last_id). - each do |message| - broadcast(message.channel, message.payload) - self.last_id = message.id - end + ::SolidCable::Message.broadcastable(channels, last_id). + each do |message| + broadcast(message.channel, message.payload) + self.last_id = message.id end end