refactor: rollback db changes with defer everywhere

This commit is contained in:
Elias Schneider
2025-04-06 23:40:46 +02:00
parent 3ebff09d63
commit ce6e27d0ff
6 changed files with 9 additions and 30 deletions

View File

@@ -207,7 +207,6 @@ func (s *AppConfigService) UpdateAppConfig(ctx context.Context, input dto.AppCon
tx := s.db.Begin()
defer func() {
// This is a no-op if the transaction has been committed already
tx.Rollback()
}()
@@ -345,7 +344,6 @@ func (s *AppConfigService) UpdateImage(ctx context.Context, uploadedFile *multip
func (s *AppConfigService) InitDbConfig(ctx context.Context) (err error) {
tx := s.db.Begin()
defer func() {
// This is a no-op if the transaction has been committed already
tx.Rollback()
}()