Merge pull request #900 from nats-io/fix_budget_flush

Fixed use of flush budget for connections other than ROUTER
This commit is contained in:
Ivan Kozlovic
2019-02-07 16:07:22 -07:00
committed by GitHub

View File

@@ -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.