commit 11da04233e73adb37636ae64d0ed429a340eef69
parent 8ad1d92d2127cb1ee5734804cf56ce99b73d8c2b
Author: lash <dev@holbrook.no>
Date: Sun, 19 Jan 2025 10:27:54 +0000
Set tx to nil on rollback
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/db/postgres/pg.go b/db/postgres/pg.go
@@ -127,6 +127,7 @@ func (pdb *pgDb) stop(ctx context.Context) error {
func (pdb *pgDb) Abort(ctx context.Context) {
logg.InfoCtxf(ctx, "aborting tx", "tx", pdb.tx)
pdb.tx.Rollback(ctx)
+ pdb.tx = nil
}
// Put implements Db.