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

[5.1] Fix missing queue name on sync job #15368

Merged
merged 1 commit into from
Sep 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Illuminate/Queue/Jobs/SyncJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ class SyncJob extends Job implements JobContract
*
* @param \Illuminate\Container\Container $container
* @param string $payload
* @param string $queue
* @return void
*/
public function __construct(Container $container, $payload)
public function __construct(Container $container, $payload, $queue)
{
$this->payload = $payload;
$this->container = $container;
$this->queue = $queue;
}

/**
Expand Down
7 changes: 4 additions & 3 deletions src/Illuminate/Queue/SyncQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SyncQueue extends Queue implements QueueContract
*/
public function push($job, $data = '', $queue = null)
{
$queueJob = $this->resolveJob($this->createPayload($job, $data, $queue));
$queueJob = $this->resolveJob($this->createPayload($job, $data, $queue), $queue);

try {
$queueJob->fire();
Expand Down Expand Up @@ -82,11 +82,12 @@ public function pop($queue = null)
* Resolve a Sync job instance.
*
* @param string $payload
* @param string $queue
* @return \Illuminate\Queue\Jobs\SyncJob
*/
protected function resolveJob($payload)
protected function resolveJob($payload, $queue)
{
return new SyncJob($this->container, $payload);
return new SyncJob($this->container, $payload, $queue);
}

/**
Expand Down