Skip to content

Commit

Permalink
fixup! raft: add MaxInflightBytes to Config
Browse files Browse the repository at this point in the history
  • Loading branch information
pav-kv committed Nov 10, 2022
1 parent a3265af commit e1cb79e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions raft/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ func (c *Config) validate() error {
if c.MaxInflightMsgs <= 0 {
return errors.New("max inflight messages must be greater than 0")
}
if c.MaxInflightBytes == 0 {
c.MaxInflightBytes = noLimit
} else if c.MaxInflightBytes < c.MaxSizePerMsg {
return errors.New("max inflight bytes must be >= max message size")
}

if c.Logger == nil {
c.Logger = getLogger()
Expand Down

0 comments on commit e1cb79e

Please sign in to comment.