Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed Dec 9, 2020
1 parent 5ef349b commit ed6bd2e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/Illuminate/Queue/Queue.php
Expand Up @@ -278,7 +278,7 @@ protected function enqueueUsing($job, $payload, $queue, $delay, $callback)
if ($this->shouldDispatchAfterCommit($job) &&
$this->container->bound('db.transactions')) {
return $this->container->make('db.transactions')->addCallback(
$callback
$this->afterCommitCallback($payload, $queue, $delay, $callback)
);
}

Expand All @@ -304,6 +304,22 @@ protected function shouldDispatchAfterCommit($job)
return false;
}

/**
* Create the after commit callback.
*
* @param string $payload
* @param string $queue
* @param \DateTimeInterface|\DateInterval|int|null $delay
* @param callable $callback
* @return callable
*/
protected function afterCommitCallback($payload, $queue, $delay, $callback)
{
return function () use ($delay, $queue, $payload, $callback) {
return $callback($payload, $queue, $delay);
};
}

/**
* Get the connection name for the queue.
*
Expand Down

0 comments on commit ed6bd2e

Please sign in to comment.