Skip to content

Commit 4056a9e

Browse files
committed
Use redis_connector to create redis connections for both subscriptions and broadcasts
1 parent c57e723 commit 4056a9e

File tree

1 file changed

+6
-2
lines changed
  • actioncable/lib/action_cable/subscription_adapter

1 file changed

+6
-2
lines changed

actioncable/lib/action_cable/subscription_adapter/redis.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def shutdown
3333
end
3434

3535
def redis_connection_for_subscriptions
36-
::Redis.new(@server.config.cable)
36+
redis_connection
3737
end
3838

3939
private
@@ -43,10 +43,14 @@ def listener
4343

4444
def redis_connection_for_broadcasts
4545
@redis_connection_for_broadcasts || @server.mutex.synchronize do
46-
@redis_connection_for_broadcasts ||= self.class.redis_connector.call(@server.config.cable)
46+
@redis_connection_for_broadcasts ||= redis_connection
4747
end
4848
end
4949

50+
def redis_connection
51+
self.class.redis_connector.call(@server.config.cable)
52+
end
53+
5054
class Listener < SubscriberMap
5155
def initialize(adapter)
5256
super()

0 commit comments

Comments
 (0)