diff --git a/src/Illuminate/Foundation/Queue/InteractsWithUniqueJobs.php b/src/Illuminate/Foundation/Queue/InteractsWithUniqueJobs.php index c517dd092b35..227b6a6b7459 100644 --- a/src/Illuminate/Foundation/Queue/InteractsWithUniqueJobs.php +++ b/src/Illuminate/Foundation/Queue/InteractsWithUniqueJobs.php @@ -54,7 +54,7 @@ private function getUniqueJobCacheStore($job): ?string } /** - * Determine if job should be unique. + * Determine if job uses unique locks. * * @param mixed $job * @return bool diff --git a/src/Illuminate/Queue/CallQueuedHandler.php b/src/Illuminate/Queue/CallQueuedHandler.php index 510ea718a3e5..87a25a0f3db1 100644 --- a/src/Illuminate/Queue/CallQueuedHandler.php +++ b/src/Illuminate/Queue/CallQueuedHandler.php @@ -207,24 +207,6 @@ protected function ensureUniqueJobLockIsReleased($command) } } - /** - * Ensure the lock for a unique job is released - * when can't unserialize the job instance. - * - * @return void - */ - protected function ensureUniqueJobLockIsReleasedWithoutInstance() - { - /** @var string */ - $driver = context()->getHidden('laravel_unique_job_cache_driver'); - /** @var string */ - $key = context()->getHidden('laravel_unique_job_key'); - - if ($driver && $key) { - cache()->driver($driver)->lock($key)->forceRelease(); - } - } - /** * Handle a model not found exception. * @@ -254,6 +236,24 @@ protected function handleModelNotFound(Job $job, $e) return $job->fail($e); } + /** + * Ensure the lock for a unique job is released + * when can't unserialize the job instance. + * + * @return void + */ + protected function ensureUniqueJobLockIsReleasedWithoutInstance() + { + /** @var string */ + $driver = context()->getHidden('laravel_unique_job_cache_driver'); + /** @var string */ + $key = context()->getHidden('laravel_unique_job_key'); + + if ($driver && $key) { + cache()->driver($driver)->lock($key)->forceRelease(); + } + } + /** * Call the failed method on the job instance. *