Update filters on writer goroutine

This commit is contained in:
Kegan Dougal 2020-09-01 19:27:21 +01:00
parent fcdb90c91b
commit 6410b702ce

View file

@ -525,7 +525,13 @@ func (d *Database) GetFilter(
func (d *Database) PutFilter(
ctx context.Context, localpart string, filter *gomatrixserverlib.Filter,
) (string, error) {
return d.Filter.InsertFilter(ctx, filter, localpart)
var filterID string
var err error
err = d.Writer.Do(nil, nil, func(txn *sql.Tx) error {
filterID, err = d.Filter.InsertFilter(ctx, filter, localpart)
return err
})
return filterID, err
}
func (d *Database) IncrementalSync(