diff options
author | Ilia Kasianenko <i.kasianenko@gmail.com> | 2018-09-05 16:54:44 +0300 |
---|---|---|
committer | Ilia Kasianenko <i.kasianenko@gmail.com> | 2018-09-05 16:54:44 +0300 |
commit | bcd11e07b5369b661e869631dc485fd5e3ce88a5 (patch) | |
tree | 50ac04f30ef265a31b58f8143acf42f2d0f62fb1 /actioncable/lib/action_cable | |
parent | bd932f5d2244185527c57d81ee7b6a7762560ab5 (diff) | |
download | rails-bcd11e07b5369b661e869631dc485fd5e3ce88a5.tar.gz rails-bcd11e07b5369b661e869631dc485fd5e3ce88a5.tar.bz2 rails-bcd11e07b5369b661e869631dc485fd5e3ce88a5.zip |
ActionCable: add id option to redis adapter config
Diffstat (limited to 'actioncable/lib/action_cable')
-rw-r--r-- | actioncable/lib/action_cable/subscription_adapter/redis.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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(*) |