Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
fix(database): correct the log type for ineffectual transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Oct 15, 2022
1 parent ef59fd0 commit ad92186
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions database/helpers/transaction_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import DatabaseError from "$!/errors/database"
export default class implements TransactionManagerInterface {
private rawTransaction: Transaction|null = null

async initialize() {
async initialize(): Promise<void> {
if (this.rawTransaction === null && this.isPermitted) {
/*
* For informred decision, please read:
Expand Down Expand Up @@ -51,7 +51,7 @@ export default class implements TransactionManagerInterface {
}
}

async destroySuccessfully() {
async destroySuccessfully(): Promise<void> {
if (this.mayDestroy) {
await this.transaction.commit()
this.rawTransaction = null
Expand All @@ -60,12 +60,12 @@ export default class implements TransactionManagerInterface {
}
}

async destroyIneffectually() {
async destroyIneffectually(): Promise<void> {
if (this.mayDestroy) {
await this.transaction.rollback()
this.rawTransaction = null

Log.success("transaction", "rolled back the database changes")
Log.errorMessage("transaction", "rolled back the database changes")
}
}

Expand Down

0 comments on commit ad92186

Please sign in to comment.