fix: fixed and changed to footprint update by transactions

This commit is contained in:
Christoph Kluge
2024-10-22 14:37:22 +02:00
parent 82e28f26d7
commit 63b9e619a4
3 changed files with 40 additions and 27 deletions

View File

@@ -49,7 +49,6 @@ func (r *JobRepository) TransactionEnd(t *Transaction) error {
log.Warn("Error while committing SQL transactions")
return err
}
return nil
}
@@ -74,11 +73,16 @@ func (r *JobRepository) TransactionAddNamed(
}
func (r *JobRepository) TransactionAdd(t *Transaction, query string, args ...interface{}) (int64, error) {
res := t.tx.MustExec(query, args)
res, err := t.tx.Exec(query, args...)
if err != nil {
log.Errorf("TransactionAdd(), Exec() Error: %v", err)
return 0, err
}
id, err := res.LastInsertId()
if err != nil {
log.Errorf("repository initDB(): %v", err)
log.Errorf("TransactionAdd(), LastInsertId() Error: %v", err)
return 0, err
}