Skip to content

Commit

Permalink
remove the need to call PendingDispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed Jun 28, 2020
1 parent 891a29d commit de662da
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Illuminate/Foundation/Bus/PendingChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Illuminate\Foundation\Bus;

use Closure;
use Illuminate\Contracts\Bus\Dispatcher;
use Illuminate\Queue\CallQueuedClosure;
use Illuminate\Queue\SerializableClosure;

Expand Down Expand Up @@ -87,7 +88,7 @@ public function catchCallbacks()
*/
public function onConnection($connection)
{
$this->job->onConnection($connection);
$this->connection = $connection;

return $this;
}
Expand All @@ -100,7 +101,7 @@ public function onConnection($connection)
*/
public function onQueue($queue)
{
$this->job->onQueue($queue);
$this->queue = $queue;

return $this;
}
Expand All @@ -121,9 +122,11 @@ public function dispatch()
}

$firstJob->chainCatchCallbacks = $this->catchCallbacks();

$firstJob->allOnQueue($this->queue);
$firstJob->allOnConnection($this->connection);
$firstJob->chain($this->chain);

return (new PendingDispatch($firstJob))->chain($this->chain);
return app(Dispatcher::class)->dispatch($firstJob);
}
}

0 comments on commit de662da

Please sign in to comment.