File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ pub struct Opts {
3838 /// An optional message explaining why the crate was deleted.
3939 #[ arg( long) ]
4040 message : Option < String > ,
41+
42+ /// The amount of time (in hours) before making the crate available
43+ /// for re-registration.
44+ #[ arg( long, default_value = "24" ) ]
45+ availability_delay : i64 ,
4146}
4247
4348pub async fn run ( opts : Opts ) -> anyhow:: Result < ( ) > {
@@ -75,6 +80,7 @@ pub async fn run(opts: Opts) -> anyhow::Result<()> {
7580 }
7681
7782 let now = Utc :: now ( ) ;
83+ let available_at = now + chrono:: TimeDelta :: hours ( opts. availability_delay ) ;
7884
7985 for name in & crate_names {
8086 if let Some ( crate_info) = existing_crates. iter ( ) . find ( |info| info. name == * name) {
@@ -86,7 +92,7 @@ pub async fn run(opts: Opts) -> anyhow::Result<()> {
8692 . deleted_at ( & now)
8793 . deleted_by ( deleted_by. id )
8894 . maybe_message ( opts. message . as_deref ( ) )
89- . available_at ( & now )
95+ . available_at ( & available_at )
9096 . build ( ) ;
9197
9298 info ! ( "{name}: Deleting crate from the database…" ) ;
You can’t perform that action at this time.
0 commit comments