File tree 3 files changed +16
-5
lines changed
3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -22,3 +22,10 @@ pub mod collected {
22
22
// nothing
23
23
}
24
24
}
25
+
26
+ pub mod next_commit {
27
+ #[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
28
+ pub struct Response {
29
+ pub commit : Option < String > ,
30
+ }
31
+ }
Original file line number Diff line number Diff line change @@ -171,13 +171,14 @@ fn bench_next(
171
171
) -> anyhow:: Result < ( ) > {
172
172
println ! ( "processing commits" ) ;
173
173
let client = reqwest:: blocking:: Client :: new ( ) ;
174
- let commit : Option < String > = client
174
+ let response : collector :: api :: next_commit :: Response = client
175
175
. get ( & format ! ( "{}/perf/next_commit" , site_url) )
176
176
. send ( ) ?
177
177
. json ( ) ?;
178
- let commit = if let Some ( c) = commit {
178
+ let commit = if let Some ( c) = response . commit {
179
179
c
180
180
} else {
181
+ println ! ( "no commit to benchmark" ) ;
181
182
// no missing commits
182
183
return Ok ( ( ) ) ;
183
184
} ;
Original file line number Diff line number Diff line change @@ -288,12 +288,15 @@ pub async fn handle_status_page(data: Arc<InputData>) -> status::Response {
288
288
}
289
289
}
290
290
291
- pub async fn handle_next_commit ( data : Arc < InputData > ) -> Option < String > {
292
- data. missing_commits ( )
291
+ pub async fn handle_next_commit ( data : Arc < InputData > ) -> collector:: api:: next_commit:: Response {
292
+ let commit = data
293
+ . missing_commits ( )
293
294
. await
294
295
. iter ( )
295
296
. next ( )
296
- . map ( |c| c. 0 . sha . to_string ( ) )
297
+ . map ( |c| c. 0 . sha . to_string ( ) ) ;
298
+
299
+ collector:: api:: next_commit:: Response { commit }
297
300
}
298
301
299
302
struct CommitIdxCache {
You can’t perform that action at this time.
0 commit comments