Skip to content

Commit eb72f4f

Browse files
authored
worker: Adjust ProcessCloudfrontInvalidationQueue to run in dedicated single-worker queue (#11843)
This should avoid multiple instances of the background job from running in parallel due to them running on the multi-worker default queue. Having the jobs run in parallel is not breaking anything, but is causing unnecessary duplicate invalidations that we should avoid.
1 parent e07f818 commit eb72f4f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/bin/background-worker.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ fn main() -> anyhow::Result<()> {
121121
.configure_default_queue(|queue| queue.num_workers(5))
122122
.configure_queue("downloads", |queue| queue.num_workers(1))
123123
.configure_queue("repository", |queue| queue.num_workers(1))
124+
.configure_queue("cloudfront", |queue| queue.num_workers(1))
124125
.register_crates_io_job_types();
125126

126127
runtime.block_on(async {

src/worker/jobs/process_cloudfront_invalidation_queue.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ impl ProcessCloudfrontInvalidationQueue {
9696
impl BackgroundJob for ProcessCloudfrontInvalidationQueue {
9797
const JOB_NAME: &'static str = "process_cloudfront_invalidation_queue";
9898
const DEDUPLICATED: bool = true;
99+
const QUEUE: &'static str = "cloudfront";
99100

100101
type Context = Arc<Environment>;
101102

0 commit comments

Comments
 (0)