mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Signed-off-by: monkey92t <golang@88.com>
This commit is contained in:
@ -1857,7 +1857,7 @@ type XInfoConsumersCmd struct {
|
|||||||
type XInfoConsumer struct {
|
type XInfoConsumer struct {
|
||||||
Name string
|
Name string
|
||||||
Pending int64
|
Pending int64
|
||||||
Idle int64
|
Idle time.Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ Cmder = (*XInfoConsumersCmd)(nil)
|
var _ Cmder = (*XInfoConsumersCmd)(nil)
|
||||||
@ -1906,19 +1906,21 @@ func (cmd *XInfoConsumersCmd) readReply(rd *proto.Reader) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var idle int64
|
||||||
switch key {
|
switch key {
|
||||||
case "name":
|
case "name":
|
||||||
cmd.val[i].Name, err = rd.ReadString()
|
cmd.val[i].Name, err = rd.ReadString()
|
||||||
case "pending":
|
case "pending":
|
||||||
cmd.val[i].Pending, err = rd.ReadInt()
|
cmd.val[i].Pending, err = rd.ReadInt()
|
||||||
case "idle":
|
case "idle":
|
||||||
cmd.val[i].Idle, err = rd.ReadInt()
|
idle, err = rd.ReadInt()
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("redis: unexpected content %s in XINFO CONSUMERS reply", key)
|
return fmt.Errorf("redis: unexpected content %s in XINFO CONSUMERS reply", key)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
cmd.val[i].Idle = time.Duration(idle) * time.Millisecond
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user