Skip to content

Commit 44cbaaa

Browse files
authored
defer transaction handling
1 parent cca2712 commit 44cbaaa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/sinks/postgres.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ func (pgw *PostgresWriter) StartMaintenanceActivity(ctx context.Context, activit
547547
logger.Errorf("Starting transaction for %s maintenance failed: %w", activity, err)
548548
return false
549549
}
550-
func() {
550+
defer func() {
551551
if err != nil {
552552
_ = tx.Rollback(pgw.ctx)
553553
} else {

0 commit comments

Comments
 (0)