Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
AnourValar committed Apr 16, 2020
1 parent 44ea313 commit ef4ef89
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Atom::onCommit(function ()
```


### Action after transaction rollback
### Action after transaction rollBack
```php
Atom::onRollback(function ()
Atom::onRollBack(function ()
{
Storage::delete('file.jpg');
});
Expand Down
4 changes: 2 additions & 2 deletions src/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ public function onCommit(callable $closure, string $connection = null) : void
}

/**
* Action after transaction rollback
* Action after transaction rollBack
*
* @param callable $closure
* @param string $connection
* @return void
*/
public function onRollback(callable $closure, string $connection = null) : void
public function onRollBack(callable $closure, string $connection = null) : void
{
if (\DB::connection($connection)->transactionLevel()) {
\Event::listen(TransactionRolledBack::class, function () use ($closure, $connection)
Expand Down
4 changes: 2 additions & 2 deletions src/Strategies/PessimisticTransactionStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ protected function apply(string $sha1, Connection $connection, string $table, bo
$connection->table($table)->insert(['sha1' => $sha1, 'updated_at' => date('Y-m-d H:i:s')]);
$connection->commit();
} catch (\Illuminate\Database\QueryException $e) {
$connection->rollback();
$connection->rollBack();
} catch (\Throwable $e) {
$connection->rollback();
$connection->rollBack();

throw $e;
}
Expand Down

0 comments on commit ef4ef89

Please sign in to comment.