Skip to content
Discussion options

You must be logged in to vote

This is expected behavior, not a bug in the logic — but it's a real documentation gap.

The actual condition in CallQueuedHandler.php

The code you quoted has &&, but the actual condition in ensureSuccessfulBatchJobIsRecorded uses ||:

protected function ensureSuccessfulBatchJobIsRecorded($command)
{
    $uses = class_uses_recursive($command);

    if (! in_array(Batchable::class, $uses) ||
        ! in_array(InteractsWithQueue::class, $uses) ||
        is_null($command->batch())) {
        return;
    }

    $command->batch()->recordSuccessfulJob($command->job->uuid());
}

With ||, both traits are required — if either is absent, the method returns early and recordSuccessfulJob() never fires.…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by benjaminmal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants