aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable
diff options
context:
space:
mode:
authorIlia Kasianenko <i.kasianenko@gmail.com>2018-09-05 16:54:44 +0300
committerIlia Kasianenko <i.kasianenko@gmail.com>2018-09-05 16:54:44 +0300
commitbcd11e07b5369b661e869631dc485fd5e3ce88a5 (patch)
tree50ac04f30ef265a31b58f8143acf42f2d0f62fb1 /actioncable/lib/action_cable
parentbd932f5d2244185527c57d81ee7b6a7762560ab5 (diff)
downloadrails-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.rb3
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(*)