Use limits instead of periods

This commit is contained in:
Ian Gulliver
2021-09-26 04:33:08 +00:00
parent eb56b5ddd9
commit 5f61b928f8
3 changed files with 8 additions and 3 deletions

View File

@@ -70,7 +70,10 @@ func (c *Client) get(path string, values *url.Values, out interface{}) error {
return err
}
c.rateLimit.Acquire1()
c.concurrencyLimitRead.Acquire1()
resp, err := c.client.Do(req)
c.concurrencyLimitRead.Release1()
if err != nil {
return err
}
@@ -120,7 +123,10 @@ func (c *Client) doWithBody(method string, path string, body interface{}, out in
return err
}
c.rateLimit.Acquire1()
c.concurrencyLimitWrite.Acquire1()
resp, err := c.client.Do(req)
c.concurrencyLimitWrite.Release1()
if err != nil {
return err
}