diff --git a/src/Illuminate/Queue/CallQueuedHandler.php b/src/Illuminate/Queue/CallQueuedHandler.php index 61126c775834..1fae8564d575 100644 --- a/src/Illuminate/Queue/CallQueuedHandler.php +++ b/src/Illuminate/Queue/CallQueuedHandler.php @@ -29,6 +29,13 @@ class CallQueuedHandler */ protected $container; + /** + * Indicates if the unique job lock has been released. + * + * @var bool + */ + protected $uniqueLockReleased = false; + /** * Create a new handler instance. * @@ -171,7 +178,7 @@ protected function ensureSuccessfulBatchJobIsRecorded($command) */ protected function ensureUniqueJobLockIsReleased($command) { - if (! $command instanceof ShouldBeUnique) { + if (! ($command instanceof ShouldBeUnique) || $this->uniqueLockReleased) { return; } @@ -186,6 +193,8 @@ protected function ensureUniqueJobLockIsReleased($command) $cache->lock( 'laravel_unique_job:'.get_class($command).$uniqueId )->forceRelease(); + + $this->uniqueLockReleased = true; } /**