Skip to content

Commit

Permalink
dont decrement below 0
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jul 24, 2020
1 parent 219f406 commit 7681795
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Concerns/ManagesTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function commit()
*/
protected function handleCommitTransactionException($e, $currentAttempt, $maxAttempts)
{
$this->transactions--;
$this->transactions = max(0, $this->transactions - 1);

if ($this->causedByConcurrencyError($e) &&
$currentAttempt < $maxAttempts) {
Expand Down

0 comments on commit 7681795

Please sign in to comment.