1
1
use anyhow:: anyhow;
2
2
use octocrab:: params:: checks:: { CheckRunConclusion , CheckRunStatus } ;
3
- use std:: sync:: { Arc , OnceLock } ;
4
- use tokio:: sync:: Mutex ;
3
+ use std:: sync:: Arc ;
5
4
6
5
use crate :: {
7
6
BorsContext ,
@@ -14,7 +13,10 @@ use crate::{
14
13
handlers:: labels:: handle_label_trigger,
15
14
} ,
16
15
database:: { BuildStatus , MergeableState , PullRequestModel } ,
17
- github:: { CommitSha , LabelTrigger , MergeError , api:: client:: GithubRepositoryClient , api:: operations:: ForcePush } ,
16
+ github:: {
17
+ CommitSha , LabelTrigger , MergeError , api:: client:: GithubRepositoryClient ,
18
+ api:: operations:: ForcePush ,
19
+ } ,
18
20
utils:: sort_queue:: sort_queue_prs,
19
21
} ;
20
22
@@ -26,8 +28,6 @@ pub(super) const AUTO_MERGE_BRANCH_NAME: &str = "automation/bors/auto-merge";
26
28
/// This branch should run CI checks.
27
29
pub ( super ) const AUTO_BRANCH_NAME : & str = "automation/bors/auto" ;
28
30
29
- static MERGE_QUEUE_LOCK : OnceLock < Mutex < ( ) > > = OnceLock :: new ( ) ;
30
-
31
31
pub type MergeQueueEvent = ( ) ;
32
32
33
33
enum MergeResult {
@@ -36,10 +36,6 @@ enum MergeResult {
36
36
}
37
37
38
38
pub async fn handle_merge_queue ( ctx : Arc < BorsContext > ) -> anyhow:: Result < ( ) > {
39
- // Prevent concurrent merge queue processing.
40
- let lock = MERGE_QUEUE_LOCK . get_or_init ( || Mutex :: new ( ( ) ) ) ;
41
- let _guard = lock. lock ( ) . await ;
42
-
43
39
let repos: Vec < Arc < RepositoryState > > =
44
40
ctx. repositories . read ( ) . unwrap ( ) . values ( ) . cloned ( ) . collect ( ) ;
45
41
0 commit comments