Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch with Job Chaining on specified queue does not seem to be working #35739

Closed
streamingsystems opened this issue Dec 28, 2020 · 1 comment · Fixed by #35746
Closed

Batch with Job Chaining on specified queue does not seem to be working #35739

streamingsystems opened this issue Dec 28, 2020 · 1 comment · Fixed by #35746
Assignees
Labels

Comments

@streamingsystems
Copy link

  • Laravel Version: 8.20.1
  • PHP Version: 8.0
  • Database Driver & Version: Mysql 8

Description:

Hello,

I am implementing some code using the new batch queue processing (using chains). I am seeing something odd and wanted to see if I was doing anything wrong.

I am running a simple test using the code below I would expect all my Jobs to all run on 'my-queue'.

What I am seeing is the TestJob1's both run on the correct queue (my-queue), however TestJob2 is running on the default queue.

$batch = Bus::batch([
            [
                new TestJob1(),
                new TestJob2(),
            ],
            [
                new TestJob1(),
                new TestJob2(),
            ]
        ])->then(function (Batch $batch) {
           
        })->catch(function (Batch $batch, Throwable $e) {
            
        })->finally(function (Batch $batch) {
            
        })->allowFailures()->onQueue('my-queue')->dispatch();

However, when I pull them out of the chain and run them as a series of batches it seems to work fine:


$batch = Bus::batch([
            new TestJob1(),
            new TestJob2(),
            new TestJob1(),
            new TestJob2(),
        ])->then(function (Batch $batch) {
            
        })->catch(function (Batch $batch, Throwable $e) {
            
        })->finally(function (Batch $batch) {
           
        })->allowFailures()->onQueue('my-queue')->dispatch();

Thanks!

@themsaid
Copy link
Member

Thanks for reporting this. I've opened a PR that will fix it: #35746

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants