SQL: close rows to release connection (#97147)

* SQL: close rows to release connection

* dont return err from rows.Close()
This commit is contained in:
Matheus Macabu
2024-11-28 14:28:55 +01:00
committed by GitHub
parent 0bf9d68070
commit f2b96593ea
6 changed files with 25 additions and 4 deletions
@@ -42,6 +42,9 @@ func GetAccessPolicies(ctx context.Context, orgID int64, sql *session.SessionDB,
if err != nil {
return nil, err
}
defer func() {
_ = rows.Close()
}()
created := time.Now()
updated := time.Now()
@@ -222,6 +222,11 @@ func (s *sqlStore) ListAll(ctx context.Context, orgId int64) ([]playlist.Playlis
if err != nil {
return nil, err
}
defer func() {
_ = rows.Close()
}()
for rows.Next() {
err = rows.Scan(&playlistId, &itemType, &itemValue)
if err != nil {