Skip to content

Commit

Permalink
fix redis test
Browse files Browse the repository at this point in the history
  • Loading branch information
abraithwaite committed Jul 9, 2024
1 parent 9deee65 commit bd14efa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions test/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ func TestRedis(t *testing.T) {
Password: "", // No password set
DB: 0, // Use default DB
})
gid := ksuid.New().String()
_, err := rc.XGroupCreateMkStream(context.Background(), "kawa/topic", gid, "$").Result()
_, err := rc.XGroupCreateMkStream(context.Background(), "kawa/topic", "kawa", "$").Result()
if err != nil {
fmt.Println("err initing", err)
}
Expand Down
5 changes: 4 additions & 1 deletion x/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

goredis "github.com/redis/go-redis/v9"
"github.com/runreveal/kawa"
"github.com/segmentio/ksuid"
)

type Options struct {
Expand Down Expand Up @@ -98,11 +99,13 @@ func (s *Source) Run(ctx context.Context) error {
func (s *Source) recvLoop(ctx context.Context) error {
var err error

gid := ksuid.New().String()

outer:
for {
msgs, err := s.client.XReadGroup(ctx, &goredis.XReadGroupArgs{
Group: "kawa",
Consumer: "1",
Consumer: gid,
Streams: []string{s.opts.topic, ">"},
Count: 100,
Block: 0,
Expand Down

0 comments on commit bd14efa

Please sign in to comment.