Skip to content

Commit

Permalink
Merge pull request #900 from nats-io/fix_budget_flush
Browse files Browse the repository at this point in the history
Fixed use of flush budget for connections other than ROUTER
  • Loading branch information
kozlovic committed Feb 7, 2019
2 parents a733e67 + 235e7f9 commit fe3289b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions server/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -721,10 +721,11 @@ func (c *client) readLoop() {

// Budget to spend in place flushing outbound data.
// Client will be checked on several fronts to see
// if applicable. Routes will never wait in place.
budget := time.Millisecond
if c.kind == ROUTER {
budget = 0
// if applicable. Routes and Gateways will never
// wait in place.
var budget time.Duration
if c.kind == CLIENT {
budget = time.Millisecond
}

// Check pending clients for flush.
Expand Down

0 comments on commit fe3289b

Please sign in to comment.