1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

fix: add XInfoConsumers test

Signed-off-by: monkey92t <golang@88.com>
This commit is contained in:
monkey92t
2022-03-19 20:54:27 +08:00
parent 997ab5e7e3
commit 6f1a1ac284
2 changed files with 3 additions and 2 deletions

View File

@ -1906,21 +1906,21 @@ func (cmd *XInfoConsumersCmd) readReply(rd *proto.Reader) error {
return err
}
var idle int64
switch key {
case "name":
cmd.val[i].Name, err = rd.ReadString()
case "pending":
cmd.val[i].Pending, err = rd.ReadInt()
case "idle":
var idle int64
idle, err = rd.ReadInt()
cmd.val[i].Idle = time.Duration(idle) * time.Millisecond
default:
return fmt.Errorf("redis: unexpected content %s in XINFO CONSUMERS reply", key)
}
if err != nil {
return err
}
cmd.val[i].Idle = time.Duration(idle) * time.Millisecond
}
}