mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-14 05:12:26 +03:00
More rows.Close()
and rows.Err()
(#3262)
Looks like we missed some `rows.Close()` Even though `rows.Err()` is mostly not necessary, we should be more consistent in the DB layer. [skip ci]
This commit is contained in:
parent
ee73a90aea
commit
699f5ca8c1
50 changed files with 101 additions and 61 deletions
|
@ -19,6 +19,7 @@ import (
|
|||
"database/sql"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/matrix-org/dendrite/internal"
|
||||
"github.com/matrix-org/dendrite/internal/sqlutil"
|
||||
"github.com/matrix-org/dendrite/userapi/storage/tables"
|
||||
"github.com/matrix-org/gomatrixserverlib/spec"
|
||||
|
@ -95,6 +96,7 @@ func (s *accountDataStatements) SelectAccountData(
|
|||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
defer internal.CloseAndLogIfError(ctx, rows, "SelectAccountData: failed to close rows")
|
||||
|
||||
global := map[string]json.RawMessage{}
|
||||
rooms := map[string]map[string]json.RawMessage{}
|
||||
|
@ -118,7 +120,7 @@ func (s *accountDataStatements) SelectAccountData(
|
|||
}
|
||||
}
|
||||
|
||||
return global, rooms, nil
|
||||
return global, rooms, rows.Err()
|
||||
}
|
||||
|
||||
func (s *accountDataStatements) SelectAccountDataByType(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue