Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Crates.io rate limiting response display #9119

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/crates-io/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,14 @@ impl Registry {

match (self.handle.response_code()?, errors) {
(0, None) | (200, None) => {}
// We need to report this until https://github.com/rust-lang/crates.io/issues/1643 is
// handled better or cargo publishes considering the MAX rate..
(429, None) if self.host_is_crates_io() => bail!(
"The maximum publish rate for crates.io is 30 crates/min.
If the number of components of your workspace is bigger, please \
fill an issue in https://github.com/rust-lang/crates.io
For more info see: https://github.com/rust-lang/crates.io/pull/1596"
),
(503, None) if started.elapsed().as_secs() >= 29 && self.host_is_crates_io() => bail!(
"Request timed out after 30 seconds. If you're trying to \
upload a crate it may be too large. If the crate is under \
Expand Down