Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
yunwuxin committed Feb 28, 2017
1 parent 185abd3 commit 07480c3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/queue/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,13 @@ public function process(Job $job, $maxTries = 0, $delay = 0)
*/
protected function logFailedJob(Job $job)
{
if (Hook::listen('queue.failed', $job, null, true)) {
$job->delete();
$job->failed();
if (!$job->isDeleted()) {
try {
$job->delete();
$job->failed();
} finally {
Hook::listen('queue.failed', $job);
}
}

return ['job' => $job, 'failed' => true];
Expand Down

0 comments on commit 07480c3

Please sign in to comment.