File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ pub struct Opts {
38
38
crate_name : Option < String > ,
39
39
}
40
40
41
- pub fn run ( opts : Opts ) {
41
+ pub fn run ( opts : Opts ) -> anyhow :: Result < ( ) > {
42
42
let base_config = Arc :: new ( config:: Base :: from_environment ( ) ) ;
43
43
let conn = db:: connect_now ( ) . unwrap ( ) ;
44
44
@@ -103,12 +103,9 @@ pub fn run(opts: Opts) {
103
103
104
104
let mut tasks = Vec :: with_capacity ( page_size as usize ) ;
105
105
for ( version, krate_name) in versions {
106
- Version :: record_readme_rendering ( version. id , & conn) . unwrap_or_else ( |_| {
107
- panic ! (
108
- "[{}-{}] Couldn't record rendering time" ,
109
- krate_name, version. num
110
- )
111
- } ) ;
106
+ Version :: record_readme_rendering ( version. id , & conn)
107
+ . context ( "Couldn't record rendering time" ) ?;
108
+
112
109
let client = client. clone ( ) ;
113
110
let base_config = base_config. clone ( ) ;
114
111
let handle = thread:: spawn :: < _ , anyhow:: Result < ( ) > > ( move || {
@@ -147,6 +144,8 @@ pub fn run(opts: Opts) {
147
144
}
148
145
}
149
146
}
147
+
148
+ Ok ( ( ) )
150
149
}
151
150
152
151
/// Renders the readme of an uploaded crate version.
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ fn main() -> anyhow::Result<()> {
33
33
SubCommand :: DeleteCrate ( opts) => delete_crate:: run ( opts) ,
34
34
SubCommand :: DeleteVersion ( opts) => delete_version:: run ( opts) ,
35
35
SubCommand :: Populate ( opts) => populate:: run ( opts) ,
36
- SubCommand :: RenderReadmes ( opts) => render_readmes:: run ( opts) ,
36
+ SubCommand :: RenderReadmes ( opts) => render_readmes:: run ( opts) ? ,
37
37
SubCommand :: TestPagerduty ( opts) => test_pagerduty:: run ( opts) ?,
38
38
SubCommand :: TransferCrates ( opts) => transfer_crates:: run ( opts) ,
39
39
SubCommand :: VerifyToken ( opts) => verify_token:: run ( opts) . unwrap ( ) ,
You can’t perform that action at this time.
0 commit comments