@@ -5,10 +5,10 @@ use crate::{
5
5
BenchmarkRequest , BenchmarkRequestIndex , BenchmarkRequestStatus , BenchmarkRequestType ,
6
6
BenchmarkSet , CodegenBackend , CollectionId , CollectorConfig , Commit , CommitType ,
7
7
CompileBenchmark , Date , Index , Profile , QueuedCommit , Scenario , Target ,
8
- BENCHMARK_JOB_STATUS_IN_PROGRESS_STR , BENCHMARK_REQUEST_MASTER_STR ,
9
- BENCHMARK_REQUEST_RELEASE_STR , BENCHMARK_REQUEST_STATUS_ARTIFACTS_READY_STR ,
10
- BENCHMARK_REQUEST_STATUS_COMPLETED_STR , BENCHMARK_REQUEST_STATUS_IN_PROGRESS_STR ,
11
- BENCHMARK_REQUEST_TRY_STR ,
8
+ BENCHMARK_JOB_STATUS_IN_PROGRESS_STR , BENCHMARK_JOB_STATUS_QUEUED_STR ,
9
+ BENCHMARK_REQUEST_MASTER_STR , BENCHMARK_REQUEST_RELEASE_STR ,
10
+ BENCHMARK_REQUEST_STATUS_ARTIFACTS_READY_STR , BENCHMARK_REQUEST_STATUS_COMPLETED_STR ,
11
+ BENCHMARK_REQUEST_STATUS_IN_PROGRESS_STR , BENCHMARK_REQUEST_TRY_STR ,
12
12
} ;
13
13
use anyhow:: Context as _;
14
14
use chrono:: { DateTime , TimeZone , Utc } ;
@@ -1841,36 +1841,23 @@ where
1841
1841
WHERE
1842
1842
job_queue.id = picked.id
1843
1843
RETURNING
1844
- job_queue.target,
1845
1844
job_queue.backend,
1846
1845
job_queue.profile,
1847
1846
job_queue.request_tag,
1848
- job_queue.benchmark_set,
1849
1847
job_queue.created_at,
1850
- job_queue.status,
1851
1848
job_queue.started_at,
1852
1849
job_queue.retry
1853
- ), updated_request AS (
1854
- UPDATE
1855
- benchmark_request
1856
- SET
1857
- status = $6
1858
- FROM
1859
- updated_queue
1860
- WHERE
1861
- updated_queue.request_tag = benchmark_request.tag
1862
1850
)
1863
1851
SELECT
1864
1852
*
1865
1853
FROM
1866
1854
updated_queue;" ,
1867
1855
& [
1868
- & BenchmarkJobStatus :: Queued ,
1856
+ & BENCHMARK_JOB_STATUS_QUEUED_STR ,
1869
1857
& target,
1870
1858
& ( benchmark_set. 0 as i32 ) ,
1871
1859
& collector_name,
1872
1860
& BENCHMARK_JOB_STATUS_IN_PROGRESS_STR ,
1873
- & BenchmarkRequestStatus :: InProgress ,
1874
1861
] ,
1875
1862
)
1876
1863
. await ?;
@@ -1879,21 +1866,20 @@ where
1879
1866
None => Ok ( None ) ,
1880
1867
Some ( row) => {
1881
1868
let job = BenchmarkJob {
1882
- target : Target :: from_str ( & row. get :: < _ , String > ( 0 ) )
1883
- . map_err ( |e| anyhow:: anyhow!( e) ) ?,
1884
- backend : CodegenBackend :: from_str ( & row. get :: < _ , String > ( 1 ) )
1869
+ target : * target,
1870
+ backend : CodegenBackend :: from_str ( & row. get :: < _ , String > ( 0 ) )
1885
1871
. map_err ( |e| anyhow:: anyhow!( e) ) ?,
1886
- profile : Profile :: from_str ( & row. get :: < _ , String > ( 2 ) )
1872
+ profile : Profile :: from_str ( & row. get :: < _ , String > ( 1 ) )
1887
1873
. map_err ( |e| anyhow:: anyhow!( e) ) ?,
1888
- request_tag : row. get :: < _ , String > ( 3 ) ,
1889
- benchmark_set : BenchmarkSet ( row . get :: < _ , i32 > ( 4 ) as u32 ) ,
1890
- created_at : row. get :: < _ , DateTime < Utc > > ( 5 ) ,
1874
+ request_tag : row. get :: < _ , String > ( 2 ) ,
1875
+ benchmark_set : benchmark_set . clone ( ) ,
1876
+ created_at : row. get :: < _ , DateTime < Utc > > ( 3 ) ,
1891
1877
// The job is now in an in_progress state
1892
1878
status : BenchmarkJobStatus :: InProgress {
1893
- started_at : row. get :: < _ , DateTime < Utc > > ( 7 ) ,
1879
+ started_at : row. get :: < _ , DateTime < Utc > > ( 4 ) ,
1894
1880
collector_name : collector_name. into ( ) ,
1895
1881
} ,
1896
- retry : row. get :: < _ , i32 > ( 8 ) as u32 ,
1882
+ retry : row. get :: < _ , i32 > ( 5 ) as u32 ,
1897
1883
} ;
1898
1884
Ok ( Some ( job) )
1899
1885
}
0 commit comments