Skip to content

Commit 49c3363

Browse files
committed
Raise crate deletion download limit
As discussed in the last crates.io team meeting the current limit of just 100 downloads per month was too conservative. This commit raises the limit to 500 downloads per month to make self-service deletions a bit more viable in practice.
1 parent 1b86411 commit 49c3363

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/templates/crate/delete.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<li>
2727
<ul>
2828
<li>the crate only has a single owner, and</li>
29-
<li>the crate has been downloaded less than 100 times for each month it has been published, and</li>
29+
<li>the crate has been downloaded less than 500 times for each month it has been published, and</li>
3030
<li>the crate is not depended upon by any other crate on crates.io.</li>
3131
</ul>
3232
</li>

src/controllers/krate/delete.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use diesel_async::{AsyncConnection, AsyncPgConnection, RunQueryDsl};
1515
use http::request::Parts;
1616
use http::StatusCode;
1717

18-
const DOWNLOADS_PER_MONTH_LIMIT: u64 = 100;
18+
const DOWNLOADS_PER_MONTH_LIMIT: u64 = 500;
1919
const AVAILABLE_AFTER: TimeDelta = TimeDelta::hours(24);
2020

2121
/// Delete a crate.
@@ -25,7 +25,7 @@ const AVAILABLE_AFTER: TimeDelta = TimeDelta::hours(24);
2525
///
2626
/// The crate can only be deleted by the owner of the crate, and only if the
2727
/// crate has been published for less than 72 hours, or if the crate has a
28-
/// single owner, has been downloaded less than 100 times for each month it has
28+
/// single owner, has been downloaded less than 500 times for each month it has
2929
/// been published, and is not depended upon by any other crate on crates.io.
3030
#[utoipa::path(
3131
delete,
@@ -384,7 +384,7 @@ mod tests {
384384

385385
let response = delete_crate(&user, "foo").await;
386386
assert_eq!(response.status(), StatusCode::UNPROCESSABLE_ENTITY);
387-
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"only crates with less than 100 downloads per month can be deleted after 72 hours"}]}"#);
387+
assert_snapshot!(response.text(), @r#"{"errors":[{"detail":"only crates with less than 500 downloads per month can be deleted after 72 hours"}]}"#);
388388

389389
assert_crate_exists(&anon, "foo", true).await;
390390

0 commit comments

Comments
 (0)