File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ pub trait Connection: Send + Sync {
2222
2323 async fn load_index ( & mut self ) -> Index ;
2424
25+ /// Returns true if the given database backend supports the job queue system.
26+ fn supports_job_queue ( & self ) -> bool ;
27+
2528 /// None means that the caller doesn't know; it should be left alone if
2629 /// known or set to false if unknown.
2730 async fn record_compile_benchmark (
Original file line number Diff line number Diff line change @@ -2335,6 +2335,10 @@ where
23352335 . await ?;
23362336 Ok ( ( ) )
23372337 }
2338+
2339+ fn supports_job_queue ( & self ) -> bool {
2340+ true
2341+ }
23382342}
23392343
23402344fn row_to_benchmark_request ( row : & Row , row_offset : Option < usize > ) -> BenchmarkRequest {
Original file line number Diff line number Diff line change @@ -1303,7 +1303,9 @@ impl Connection for SqliteConnection {
13031303 }
13041304
13051305 async fn load_benchmark_request_index ( & self ) -> anyhow:: Result < BenchmarkRequestIndex > {
1306- no_queue_implementation_abort ! ( )
1306+ Ok ( BenchmarkRequestIndex {
1307+ all : Default :: default ( ) ,
1308+ } )
13071309 }
13081310
13091311 async fn load_pending_benchmark_requests ( & self ) -> anyhow:: Result < PendingBenchmarkRequests > {
@@ -1438,6 +1440,10 @@ impl Connection for SqliteConnection {
14381440 ) -> anyhow:: Result < Vec < BenchmarkRequestWithErrors > > {
14391441 no_queue_implementation_abort ! ( )
14401442 }
1443+
1444+ fn supports_job_queue ( & self ) -> bool {
1445+ false
1446+ }
14411447}
14421448
14431449fn parse_artifact_id ( ty : & str , sha : & str , date : Option < i64 > ) -> ArtifactId {
Original file line number Diff line number Diff line change @@ -366,6 +366,9 @@ async fn process_benchmark_requests(
366366/// finishes completed benchmark requests.
367367async fn perform_queue_tick ( ctxt : & SiteCtxt ) -> anyhow:: Result < ( ) > {
368368 let mut conn = ctxt. conn ( ) . await ;
369+ if !conn. supports_job_queue ( ) {
370+ return Ok ( ( ) ) ;
371+ }
369372
370373 let index = ctxt. known_benchmark_requests . load ( ) ;
371374
You can’t perform that action at this time.
0 commit comments