@@ -6,7 +6,7 @@ use crate::github::{
6
6
use crate :: job_queue:: run_new_queue;
7
7
use crate :: load:: SiteCtxt ;
8
8
9
- use database:: { BenchmarkRequest , BenchmarkRequestStatus } ;
9
+ use database:: BenchmarkRequest ;
10
10
use hashbrown:: HashMap ;
11
11
use std:: sync:: Arc ;
12
12
@@ -74,25 +74,18 @@ async fn handle_issue(
74
74
Ok ( github:: Response )
75
75
}
76
76
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 (
81
81
conn : & dyn database:: pool:: Connection ,
82
82
pr : u32 ,
83
83
backends : & str ,
84
84
) {
85
85
// We only want to run this if the new system is running
86
86
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, "" ) ;
96
89
if let Err ( e) = conn. insert_benchmark_request ( & try_request) . await {
97
90
log:: error!( "Failed to insert try benchmark request: {}" , e) ;
98
91
}
@@ -125,7 +118,7 @@ async fn handle_rust_timer(
125
118
Ok ( cmd) => {
126
119
let conn = ctxt. conn ( ) . await ;
127
120
128
- queue_partial_try_benchmark_request (
121
+ record_try_benchmark_request_without_artifacts (
129
122
& * conn,
130
123
issue. number ,
131
124
cmd. params . backends . unwrap_or ( "" ) ,
@@ -171,7 +164,7 @@ async fn handle_rust_timer(
171
164
{
172
165
let conn = ctxt. conn ( ) . await ;
173
166
for command in & valid_build_cmds {
174
- queue_partial_try_benchmark_request (
167
+ record_try_benchmark_request_without_artifacts (
175
168
& * conn,
176
169
issue. number ,
177
170
command. params . backends . unwrap_or ( "" ) ,
0 commit comments