Have Consul's transaction handler use the permit pool

This commit is contained in:
Jeff Mitchell 2017-03-09 12:59:35 -05:00
parent 220beb2cde
commit ff3c3db91b
1 changed files with 3 additions and 0 deletions

View File

@ -321,6 +321,9 @@ func (c *ConsulBackend) Transaction(txns []TxnEntry) error {
ops = append(ops, cop)
}
c.permitPool.Acquire()
defer c.permitPool.Release()
ok, resp, _, err := c.kv.Txn(ops, nil)
if err != nil {
return err