docs: add reading lag field comment (#2451)

Signed-off-by: monkey92t <golang@88.com>
Co-authored-by: Vladimir Mihailenco <vladimir.webdev@gmail.com>
This commit is contained in:
Monkey 2023-02-24 20:21:12 +08:00 committed by GitHub
parent 6ec458549e
commit e309eaf915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -2057,6 +2057,9 @@ func (cmd *XInfoGroupsCmd) readReply(rd *proto.Reader) error {
} }
case "lag": case "lag":
group.Lag, err = rd.ReadInt() group.Lag, err = rd.ReadInt()
// lag: the number of entries in the stream that are still waiting to be delivered
// to the group's consumers, or a NULL(Nil) when that number can't be determined.
if err != nil && err != Nil { if err != nil && err != Nil {
return err return err
} }
@ -2366,6 +2369,8 @@ func readStreamGroups(rd *proto.Reader) ([]XInfoStreamGroup, error) {
return nil, err return nil, err
} }
case "lag": case "lag":
// lag: the number of entries in the stream that are still waiting to be delivered
// to the group's consumers, or a NULL(Nil) when that number can't be determined.
group.Lag, err = rd.ReadInt() group.Lag, err = rd.ReadInt()
if err != nil && err != Nil { if err != nil && err != Nil {
return nil, err return nil, err