Skip to content

Commit 3a48b8e

Browse files
Derk SchooltinkDerkSch
authored andcommitted
pass equal amount of ids as keys in xreadgroup
1 parent 3fae335 commit 3a48b8e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

backend/valkey/queue.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,13 @@ func (q *taskQueue[T]) Dequeue(ctx context.Context, client valkey.Client, queues
169169
streamKeys = append(streamKeys, keyInfo.StreamKey)
170170
}
171171

172+
ids := make([]string, len(streamKeys))
173+
for i := range ids {
174+
ids[i] = ">"
175+
}
176+
172177
// Try to dequeue from all given queues
173-
cmd := client.B().Xreadgroup().Group(q.groupName, q.workerName).Streams().Key(streamKeys...).Id(">")
178+
cmd := client.B().Xreadgroup().Group(q.groupName, q.workerName).Streams().Key(streamKeys...).Id(ids...)
174179
results, err := client.Do(ctx, cmd.Build()).AsXRead()
175180
if err != nil {
176181
// Check if error is due to no data available (nil response)

0 commit comments

Comments
 (0)