nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.25k stars 41 forks source link

Add --rate-limit flag #260

Closed paschun closed 5 months ago

paschun commented 5 months ago

Add the rate limit flag like in binstall

It's needed for binaries hosted on gitlab, otherwise get slammed with http code 429 "rate limit exceeded" Thus currently can only use binstall for binaries on gitlab, can't use cargo-update.

      --rate-limit <RATE_LIMIT>
          Override the rate limit duration.

          By default, cargo-binstall allows one request per 10 ms.

          Example:

          - `6`: Set the duration to 6ms, allows one request per 6 ms.

          - `6/2`: Set the duration to 6ms and request_count to 2, allows 2 requests per 6ms.

          Both duration and request count must not be 0.

          [env: BINSTALL_RATE_LIMIT=]
          [default: 10/1]
nabijaczleweli commented 5 months ago

Is there any particular reason you can't set BINSTALL_RATE_LIMIT?

paschun commented 5 months ago

Yes, the env variable works too. Thank you