Skip to content

[13.x] Push batched jobs to their own queue when the batch has no queue - #61450

Open
xurshudyan wants to merge 2 commits into
laravel:13.xfrom
xurshudyan:fix-batched-jobs-keep-their-queue
Open

[13.x] Push batched jobs to their own queue when the batch has no queue#61450
xurshudyan wants to merge 2 commits into
laravel:13.xfrom
xurshudyan:fix-batched-jobs-keep-their-queue

Conversation

@xurshudyan

Copy link
Copy Markdown
Contributor

When a batch is dispatched without onQueue(), every job goes to the default queue even if the job itself set a queue:

Bus::batch([
    (new ResizeImage($photo))->onQueue('images'),
])->dispatch();

// jobs.queue = "default", a worker on --queue=images never picks it up

With this change the job goes to images. Bus::batch()->onQueue() still applies to every job as before, so existing batches are not affected.

@jackbayliss

Copy link
Copy Markdown
Contributor

Seems odd to me to do this within a batch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants