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( func (d *Database) RemoveAllDevices(
ctx context.Context, localpart string, ctx context.Context, localpart string,
) (devices []api.Device, err error) { ) (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) devices, err = d.devices.selectDevicesByLocalpart(ctx, txn, localpart)
if err != nil { if err != nil {
return err return err

View file

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