@@ -6,7 +6,7 @@ use crate::github::{
66use crate :: job_queue:: run_new_queue;
77use crate :: load:: SiteCtxt ;
88
9- use database:: { BenchmarkRequest , BenchmarkRequestStatus } ;
9+ use database:: BenchmarkRequest ;
1010use hashbrown:: HashMap ;
1111use std:: sync:: Arc ;
1212
@@ -74,25 +74,18 @@ async fn handle_issue(
7474 Ok ( github:: Response )
7575}
7676
77- /// The try does not have a `sha` or a `parent_sha` but we need to keep a record
78- /// of this commit existing. We make sure there can only be one `pr` with a
79- /// status of `WaitingForArtifacts` to ensure we don't have duplicates .
80- async fn queue_partial_try_benchmark_request (
77+ /// The try request does not have a `sha` or a `parent_sha` but we need to keep a record
78+ /// of this commit existing. The DB ensures that there is only one non-completed
79+ /// try benchmark request per `pr` .
80+ async fn record_try_benchmark_request_without_artifacts (
8181 conn : & dyn database:: pool:: Connection ,
8282 pr : u32 ,
8383 backends : & str ,
8484) {
8585 // We only want to run this if the new system is running
8686 if run_new_queue ( ) {
87- let try_request = BenchmarkRequest :: create_try (
88- None ,
89- None ,
90- pr,
91- chrono:: Utc :: now ( ) ,
92- BenchmarkRequestStatus :: WaitingForArtifacts ,
93- backends,
94- "" ,
95- ) ;
87+ let try_request =
88+ BenchmarkRequest :: create_try_without_artifacts ( pr, chrono:: Utc :: now ( ) , backends, "" ) ;
9689 if let Err ( e) = conn. insert_benchmark_request ( & try_request) . await {
9790 log:: error!( "Failed to insert try benchmark request: {}" , e) ;
9891 }
@@ -125,7 +118,7 @@ async fn handle_rust_timer(
125118 Ok ( cmd) => {
126119 let conn = ctxt. conn ( ) . await ;
127120
128- queue_partial_try_benchmark_request (
121+ record_try_benchmark_request_without_artifacts (
129122 & * conn,
130123 issue. number ,
131124 cmd. params . backends . unwrap_or ( "" ) ,
@@ -171,7 +164,7 @@ async fn handle_rust_timer(
171164 {
172165 let conn = ctxt. conn ( ) . await ;
173166 for command in & valid_build_cmds {
174- queue_partial_try_benchmark_request (
167+ record_try_benchmark_request_without_artifacts (
175168 & * conn,
176169 issue. number ,
177170 command. params . backends . unwrap_or ( "" ) ,
0 commit comments