Review comments

This commit is contained in:
Kegan Dougal 2020-08-27 18:33:47 +01:00
parent 394d2c7c44
commit c43c56087f
2 changed files with 4 additions and 2 deletions

View file

@ -181,7 +181,7 @@ func (d *Database) RemoveDevices(
func (d *Database) RemoveAllDevices(
ctx context.Context, localpart string,
) (devices []api.Device, err error) {
err = sqlutil.WithTransaction(d.db, func(txn *sql.Tx) error {
err = d.writer.Do(d.db, nil, func(txn *sql.Tx) error {
devices, err = d.devices.selectDevicesByLocalpart(ctx, txn, localpart)
if err != nil {
return err

View file

@ -31,7 +31,9 @@ func MustMakeInternalAPI(t *testing.T) (api.UserInternalAPI, accounts.Database)
}
cfg := &config.UserAPI{
DeviceDatabase: config.DatabaseOptions{
ConnectionString: "file::memory:",
ConnectionString: "file::memory:",
MaxOpenConnections: 1,
MaxIdleConnections: 1,
},
Matrix: &config.Global{
ServerName: serverName,