File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
lib/action_cable/subscription_adapter
test/subscription_adapter Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change
1
+ * Allow setting nil as subscription connection identifier for Redis.
2
+
3
+ * Nguyen Nguyen*
1
4
2
5
Please check [ 8-0-stable] ( https://github.com/rails/rails/blob/8-0-stable/actioncable/CHANGELOG.md ) for previous changes.
Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ def shutdown
29
29
end
30
30
31
31
def identifier
32
- @server . config . cable [ :id ] ||= "ActionCable-PID-#{ $$} "
32
+ @server . config . cable [ :id ] = "ActionCable-PID-#{ $$} " unless @server . config . cable . key? ( :id )
33
+ @server . config . cable [ :id ]
33
34
end
34
35
end
35
36
end
Original file line number Diff line number Diff line change @@ -113,6 +113,16 @@ def connection_id
113
113
end
114
114
end
115
115
116
+ class RedisAdapterTest ::ConnectorCustomIDNil < RedisAdapterTest ::ConnectorDefaultID
117
+ def cable_config
118
+ super . merge ( id : connection_id )
119
+ end
120
+
121
+ def connection_id
122
+ nil
123
+ end
124
+ end
125
+
116
126
class RedisAdapterTest ::ConnectorWithExcluded < RedisAdapterTest ::ConnectorDefaultID
117
127
def cable_config
118
128
super . merge ( adapter : "redis" , channel_prefix : "custom" )
You can’t perform that action at this time.
0 commit comments