Skip to content

Commit 6453c00

Browse files
committed
refactor: refactor cluster initialization and update related tests
- Remove the `enable` parameter from the `WithCluster` function and set `w.cluster` to `true` by default - Update the test `TestRedisCluster` to call `WithCluster()` without parameters Signed-off-by: appleboy <[email protected]>
1 parent 898b07c commit 6453c00

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ func WithDB(db int) Option {
6060
}
6161

6262
// WithCluster redis cluster
63-
func WithCluster(enable bool) Option {
63+
func WithCluster() Option {
6464
return func(w *options) {
65-
w.cluster = enable
65+
w.cluster = true
6666
}
6767
}
6868

redis_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func TestRedisCluster(t *testing.T) {
188188
w := NewWorker(
189189
WithAddr(strings.Join(hosts, ",")),
190190
WithStreamName("testCluster"),
191-
WithCluster(true),
191+
WithCluster(),
192192
WithRunFunc(func(ctx context.Context, m core.QueuedMessage) error {
193193
time.Sleep(500 * time.Millisecond)
194194
return nil

0 commit comments

Comments
 (0)