Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 17, 2025
1 parent ed33b51 commit 1cc5a57
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 18 additions & 18 deletions src/Illuminate/Queue/CallQueuedHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit 1cc5a57

Please sign in to comment.