Skip to content

Commit e1020c6

Browse files
committed
worker/jobs: Use dedicated repository queue
This allows the other jobs to make progress without getting held up by the git repository mutex.
1 parent 28ec8c4 commit e1020c6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/bin/background-worker.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ fn main() -> anyhow::Result<()> {
105105

106106
let runner = Runner::new(runtime.handle(), connection_pool, environment.clone())
107107
.configure_default_queue(|queue| queue.num_workers(5))
108+
.configure_queue("repository", |queue| queue.num_workers(1))
108109
.register_crates_io_job_types()
109110
.start();
110111

src/worker/jobs/git.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ impl SyncToGitIndex {
2929
impl BackgroundJob for SyncToGitIndex {
3030
const JOB_NAME: &'static str = "sync_to_git_index";
3131
const PRIORITY: i16 = 100;
32+
const QUEUE: &'static str = "repository";
3233

3334
type Context = Arc<Environment>;
3435

@@ -165,6 +166,7 @@ pub struct SquashIndex;
165166
#[async_trait]
166167
impl BackgroundJob for SquashIndex {
167168
const JOB_NAME: &'static str = "squash_index";
169+
const QUEUE: &'static str = "repository";
168170

169171
type Context = Arc<Environment>;
170172

@@ -223,6 +225,7 @@ impl NormalizeIndex {
223225
#[async_trait]
224226
impl BackgroundJob for NormalizeIndex {
225227
const JOB_NAME: &'static str = "normalize_index";
228+
const QUEUE: &'static str = "repository";
226229

227230
type Context = Arc<Environment>;
228231

0 commit comments

Comments
 (0)