Skip to content

Commit a1e9c17

Browse files
committed
Clarify sentinel constructor parameters
Fix: #1188
1 parent e4f5299 commit a1e9c17

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ To connect using Sentinel, use:
103103
SENTINELS = [{ host: "127.0.0.1", port: 26380 },
104104
{ host: "127.0.0.1", port: 26381 }]
105105

106-
redis = Redis.new(url: "redis://mymaster", sentinels: SENTINELS, role: :master)
106+
redis = Redis.new(name: "mymaster", sentinels: SENTINELS, role: :master)
107107
```
108108

109109
* The master name identifies a group of Redis instances composed of a master
@@ -129,6 +129,12 @@ SENTINELS = [{ host: '127.0.0.1', port: 26380, password: 'mysecret' },
129129
redis = Redis.new(name: 'mymaster', sentinels: SENTINELS, role: :master)
130130
```
131131

132+
Also the name can be passed as an url:
133+
134+
```ruby
135+
redis = Redis.new(name: "redis://mymaster", sentinels: SENTINELS, role: :master)
136+
```
137+
132138
## Cluster support
133139

134140
[Clustering](https://redis.io/topics/cluster-spec). is supported via the [`redis-clustering` gem](cluster/).

0 commit comments

Comments
 (0)