Skip to content

Commit 193b8a4

Browse files
committed
refactor
1 parent 631c0f8 commit 193b8a4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Illuminate/Queue/Jobs/Job.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,11 @@ public function fail($e = null)
204204
}
205205
}
206206

207-
$failedJobConnectionName = $this->container['config']['queue.failed.database'];
208-
209207
// If the job times out and has an open database transaction on the same connection as
210208
// the failed jobs table, we need to rollback that transaction to ensure the failed job
211209
// can be properly logged. Otherwise, the current transaction will never commit.
212210
if ($e instanceof TimeoutExceededException &&
213-
! is_null($failedJobConnectionName) &&
211+
($failedJobConnectionName = $this->container['config']['queue.failed.database']) &&
214212
$this->container->bound('db')) {
215213
$this->container->make('db')->connection($failedJobConnectionName)->rollBack(toLevel: 0);
216214
}

0 commit comments

Comments
 (0)