Skip to content

Commit

Permalink
Fix missing queue name on sync job
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderSander committed Sep 9, 2016
1 parent 32dcea9 commit 30bda12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
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

0 comments on commit 30bda12

Please sign in to comment.