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 {
38
38
/// An optional message explaining why the crate was deleted.
39
39
#[ arg( long) ]
40
40
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 ,
41
46
}
42
47
43
48
pub async fn run ( opts : Opts ) -> anyhow:: Result < ( ) > {
@@ -75,6 +80,7 @@ pub async fn run(opts: Opts) -> anyhow::Result<()> {
75
80
}
76
81
77
82
let now = Utc :: now ( ) ;
83
+ let available_at = now + chrono:: TimeDelta :: hours ( opts. availability_delay ) ;
78
84
79
85
for name in & crate_names {
80
86
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<()> {
86
92
. deleted_at ( & now)
87
93
. deleted_by ( deleted_by. id )
88
94
. maybe_message ( opts. message . as_deref ( ) )
89
- . available_at ( & now )
95
+ . available_at ( & available_at )
90
96
. build ( ) ;
91
97
92
98
info ! ( "{name}: Deleting crate from the database…" ) ;
You can’t perform that action at this time.
0 commit comments