Skip to content

Commit

Permalink
fix: explicitly stage/clear transaction to correctly run afterCommit …
Browse files Browse the repository at this point in the history
…jobs (#144)

laravel v10.32.0 requires explicit staging of transactions
laravel/framework#48859
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
oprudkyi authored and taka-oyama committed Nov 17, 2023
1 parent 1cd26e0 commit eeb504d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v5.3.0 [Not released Yet]

Fixed
- Explicitly stage/clear transaction on commit to correctly run afterCommit jobs in Laravel >= [v10.32.0](https://github.com/laravel/framework/pull/48859) (#144)

# v5.2.2 (2023-08-22)

Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"php": "^8.1",
"ext-grpc": "*",
"ext-json": "*",
"laravel/framework": "~10.0",
"laravel/framework": "^10.32.0",
"google/cloud-spanner": "^1.58.4",
"grpc/grpc": "^1.42",
"symfony/cache": "~6",
Expand Down
2 changes: 2 additions & 0 deletions src/Concerns/ManagesTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ protected function performSpannerCommit(): void
$this->currentTransaction->commit();
}

$this->transactionsManager?->stageTransactions($this->getName());

$this->transactions = max(0, $this->transactions - 1);
if ($this->isTransactionFinished()) {
$this->currentTransaction = null;
Expand Down

0 comments on commit eeb504d

Please sign in to comment.