Commit 3cf73522 authored by ale's avatar ale

Close the sql.Statement that is bound to the transaction

parent 37e53d87
Pipeline #8007 passed with stages
in 1 minute and 34 seconds
......@@ -178,7 +178,8 @@ func (s *Service) AddDataset(ctx context.Context, backup tabacco.Backup, ds taba
return retryBusy(ctx, func() error {
return withTX(ctx, s.db, func(tx *sql.Tx) error {
for _, dbAtom := range makeAtoms(backup, ds) {
if _, err := s.stmts.get(tx, "insert_atom").Exec(
stmt := s.stmts.get(tx, "insert_atom")
_, err := stmt.Exec(
dbAtom.BackupID,
dbAtom.BackupTimestamp,
dbAtom.BackupHost,
......@@ -188,7 +189,9 @@ func (s *Service) AddDataset(ctx context.Context, backup tabacco.Backup, ds taba
dbAtom.AtomName,
dbAtom.AtomPath,
dbAtom.AtomFullPath,
); err != nil {
)
stmt.Close()
if err != nil {
return err
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment