SQL: close rows to release connection (#97147)
* SQL: close rows to release connection * dont return err from rows.Close()
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user