From bcd11e07b5369b661e869631dc485fd5e3ce88a5 Mon Sep 17 00:00:00 2001 From: Ilia Kasianenko Date: Wed, 5 Sep 2018 16:54:44 +0300 Subject: ActionCable: add id option to redis adapter config --- actioncable/lib/action_cable/subscription_adapter/redis.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actioncable/lib/action_cable') diff --git a/actioncable/lib/action_cable/subscription_adapter/redis.rb b/actioncable/lib/action_cable/subscription_adapter/redis.rb index c28951608f..ad8fa52760 100644 --- a/actioncable/lib/action_cable/subscription_adapter/redis.rb +++ b/actioncable/lib/action_cable/subscription_adapter/redis.rb @@ -13,7 +13,8 @@ module ActionCable # Overwrite this factory method for Redis connections if you want to use a different Redis library than the redis gem. # This is needed, for example, when using Makara proxies for distributed Redis. cattr_accessor :redis_connector, default: ->(config) do - ::Redis.new(config.slice(:url, :host, :port, :db, :password)) + config[:id] ||= "ActionCable-PID-#{$$}" + ::Redis.new(config.slice(:url, :host, :port, :db, :password, :id)) end def initialize(*) -- cgit v1.2.3