History sync: use indefinitely blocking XREAD

Just like we do it throughout the rest of the code.
This commit is contained in:
Julian Brost 2021-09-29 16:51:33 +02:00
parent bfcc324535
commit 8b4e4d68a6

View file

@ -103,14 +103,13 @@ func (s Sync) readFromRedis(ctx context.Context, key string, output chan<- redis
xra := &redis.XReadArgs{
Streams: []string{"icinga:history:stream:" + key, "0-0"},
Count: int64(s.redis.Options.XReadCount),
Block: 10 * time.Second,
}
for {
cmd := s.redis.XRead(ctx, xra)
streams, err := cmd.Result()
if err != nil && err != redis.Nil {
if err != nil {
return icingaredis.WrapCmdErr(cmd)
}