Skip to content

Commit 939260d

Browse files
committed
perf(db): improve error checking
1 parent eca2010 commit 939260d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

db.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ func (t *Transaction) PGX(ctx context.Context, transactions ...func(pgx.Tx) erro
101101
}()
102102
err = fn(tx)
103103
}()
104+
105+
if err == nil {
106+
continue
107+
}
104108
if errors.Is(err, context.Canceled) {
105109
err = &retry.StopError{Err: err}
106110
ctx = context.Background()
@@ -142,6 +146,10 @@ func (t *Transaction) DB(ctx context.Context, transactions ...func(Tx) error) er
142146
}()
143147
err = fn(tx)
144148
}()
149+
150+
if err == nil {
151+
continue
152+
}
145153
if errors.Is(err, context.Canceled) {
146154
err = &retry.StopError{Err: err}
147155
ctx = context.Background()

0 commit comments

Comments
 (0)