From 626dfa5b46f8ca0b7977be15b84af89bb6e32eb2 Mon Sep 17 00:00:00 2001 From: Kosmatoff Date: Mon, 13 Nov 2023 07:41:39 +0300 Subject: [PATCH] ? --- .../transaction/repository/postgresql/postgres.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/microservices/transaction/repository/postgresql/postgres.go b/internal/microservices/transaction/repository/postgresql/postgres.go index 9c68ec62..b5f0e604 100644 --- a/internal/microservices/transaction/repository/postgresql/postgres.go +++ b/internal/microservices/transaction/repository/postgresql/postgres.go @@ -120,7 +120,7 @@ func (r *transactionRep) CreateTransaction(ctx context.Context, transaction *mod return uuid.Nil, fmt.Errorf("failed to start transaction: %w", err) } defer func() { - if err := tx.Rollback(ctx); err != nil { + if err != nil { if err = tx.Rollback(ctx); err != nil { r.logger.Fatal("Rollback transaction Error: %w", err) } @@ -202,7 +202,7 @@ func (r *transactionRep) UpdateTransaction(ctx context.Context, transaction *mod } defer func() { - if err := tx.Rollback(ctx); err != nil { + if err != nil { if err = tx.Rollback(ctx); err != nil { r.logger.Fatal("Rollback transaction Error: %w", err) } @@ -300,7 +300,7 @@ func (r *transactionRep) DeleteTransaction(ctx context.Context, transactionID uu } defer func() { - if err := tx.Rollback(ctx); err != nil { + if err != nil { if err = tx.Rollback(ctx); err != nil { r.logger.Fatal("Rollback transaction Error: %w", err) }