Skip to content

Commit 222e585

Browse files
Merge branch 'master' into DOC-4560-pipe-trans-example
2 parents 004659d + caa2592 commit 222e585

File tree

6 files changed

+35
-3
lines changed

6 files changed

+35
-3
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
run: make test
4040

4141
- name: Upload to Codecov
42-
uses: codecov/codecov-action@v4
42+
uses: codecov/codecov-action@v5
4343
with:
4444
files: coverage.txt
4545
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/spellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- name: Checkout
99
uses: actions/checkout@v4
1010
- name: Check Spelling
11-
uses: rojopolis/spellcheck-github-actions@0.40.0
11+
uses: rojopolis/spellcheck-github-actions@0.45.0
1212
with:
1313
config_path: .github/spellcheck-settings.yml
1414
task_name: Markdown

command.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ func (cmd *baseCmd) stringArg(pos int) string {
167167
switch v := arg.(type) {
168168
case string:
169169
return v
170+
case []byte:
171+
return string(v)
170172
default:
171173
// TODO: consider using appendArg
172174
return fmt.Sprint(v)

osscluster_test.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,32 @@ var _ = Describe("ClusterClient", func() {
653653
Expect(client.Close()).NotTo(HaveOccurred())
654654
})
655655

656+
It("determines hash slots correctly for generic commands", func() {
657+
opt := redisClusterOptions()
658+
opt.MaxRedirects = -1
659+
client := cluster.newClusterClient(ctx, opt)
660+
661+
err := client.Do(ctx, "GET", "A").Err()
662+
Expect(err).To(Equal(redis.Nil))
663+
664+
err = client.Do(ctx, []byte("GET"), []byte("A")).Err()
665+
Expect(err).To(Equal(redis.Nil))
666+
667+
Eventually(func() error {
668+
return client.SwapNodes(ctx, "A")
669+
}, 30*time.Second).ShouldNot(HaveOccurred())
670+
671+
err = client.Do(ctx, "GET", "A").Err()
672+
Expect(err).To(HaveOccurred())
673+
Expect(err.Error()).To(ContainSubstring("MOVED"))
674+
675+
err = client.Do(ctx, []byte("GET"), []byte("A")).Err()
676+
Expect(err).To(HaveOccurred())
677+
Expect(err.Error()).To(ContainSubstring("MOVED"))
678+
679+
Expect(client.Close()).NotTo(HaveOccurred())
680+
})
681+
656682
It("follows node redirection immediately", func() {
657683
// Configure retry backoffs far in excess of the expected duration of redirection
658684
opt := redisClusterOptions()

search_commands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,7 @@ func FTSearchQuery(query string, options *FTSearchOptions) SearchQuery {
17751775
}
17761776
}
17771777
if options.SortByWithCount {
1778-
queryArgs = append(queryArgs, "WITHCOUT")
1778+
queryArgs = append(queryArgs, "WITHCOUNT")
17791779
}
17801780
}
17811781
if options.LimitOffset >= 0 && options.Limit > 0 {

search_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
125125
Expect(res2.Docs[1].ID).To(BeEquivalentTo("doc2"))
126126
Expect(res2.Docs[0].ID).To(BeEquivalentTo("doc3"))
127127

128+
res3, err := client.FTSearchWithArgs(ctx, "num", "foo", &redis.FTSearchOptions{NoContent: true, SortBy: []redis.FTSearchSortBy{sortBy2}, SortByWithCount: true}).Result()
129+
Expect(err).NotTo(HaveOccurred())
130+
Expect(res3.Total).To(BeEquivalentTo(int64(0)))
131+
128132
})
129133

130134
It("should FTCreate and FTSearch example", Label("search", "ftcreate", "ftsearch"), func() {

0 commit comments

Comments
 (0)