3
0

Return err on tx store fail

This commit is contained in:
Peter Grlica
2020-10-14 15:55:55 +02:00
parent 30fdd29a48
commit abcf13b0a3
+4 -3
View File
@@ -4,6 +4,9 @@ import (
"context"
"database/sql"
"fmt"
"strings"
"time"
"github.com/Masterminds/squirrel"
"github.com/cortezaproject/corteza-server/pkg/errors"
"github.com/cortezaproject/corteza-server/pkg/filter"
@@ -15,8 +18,6 @@ import (
"github.com/cortezaproject/corteza-server/store/rdbms/ddl"
"github.com/jmoiron/sqlx"
"go.uber.org/zap"
"strings"
"time"
)
type (
@@ -368,7 +369,7 @@ func tx(ctx context.Context, dbCandidate interface{}, cfg *Config, txOpt *sql.Tx
// Start transaction
tx, err = db.BeginTxx(ctx, txOpt)
if err != nil {
return nil
return err
}
if lastTaskErr = task(ctx, tx); lastTaskErr == nil {