Skip to content

Commit

Permalink
commit transaction of success
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorolyov committed Feb 6, 2020
1 parent 59ca85e commit 046c315
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pgx_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ func (p *PgxAdapter) Transaction(ctx context.Context, f func(context.Context, Ex
if rbErr != nil {
err = errors.Wrapf(err, "failed to rollback failed transaction: %v", rbErr)
}
return err
}

return err
if err := tx.Commit(ctx); err != nil {
return errors.Wrap(err, "failed to commit transaction")
}

return nil
}

func (p *PgxAdapter) Exec(ctx context.Context, sql string, args ...interface{}) (result RowsAffected, err error) {
Expand Down

0 comments on commit 046c315

Please sign in to comment.