mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 21:02:25 +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
|
@ -177,7 +177,7 @@ func (s *currentRoomStateStatements) SelectJoinedUsers(
|
|||
users = append(users, userID)
|
||||
result[roomID] = users
|
||||
}
|
||||
return result, nil
|
||||
return result, rows.Err()
|
||||
}
|
||||
|
||||
// SelectJoinedUsersInRoom returns a map of room ID to a list of joined user IDs for a given room.
|
||||
|
@ -236,7 +236,7 @@ func (s *currentRoomStateStatements) SelectRoomIDsWithMembership(
|
|||
}
|
||||
result = append(result, roomID)
|
||||
}
|
||||
return result, nil
|
||||
return result, rows.Err()
|
||||
}
|
||||
|
||||
// SelectRoomIDsWithAnyMembership returns a map of all memberships for the given user.
|
||||
|
@ -419,7 +419,7 @@ func currentRoomStateRowsToStreamEvents(rows *sql.Rows) ([]types.StreamEvent, er
|
|||
})
|
||||
}
|
||||
|
||||
return events, nil
|
||||
return events, rows.Err()
|
||||
}
|
||||
|
||||
func rowsToEvents(rows *sql.Rows) ([]*rstypes.HeaderedEvent, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue