Fix writers

This commit is contained in:
Neil Alexander 2020-09-01 16:30:45 +01:00
parent 6d79f04354
commit c5c8a24161
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
5 changed files with 6 additions and 6 deletions

View file

@ -93,10 +93,10 @@ type currentRoomStateStatements struct {
selectKnownUsersStmt *sql.Stmt
}
func NewSqliteCurrentRoomStateTable(db *sql.DB) (tables.CurrentRoomState, error) {
func NewSqliteCurrentRoomStateTable(db *sql.DB, writer sqlutil.Writer) (tables.CurrentRoomState, error) {
s := &currentRoomStateStatements{
db: db,
writer: sqlutil.NewExclusiveWriter(),
writer: writer,
}
_, err := db.Exec(currentRoomStateSchema)
if err != nil {

View file

@ -27,7 +27,7 @@ func NewDatabase(dbProperties *config.DatabaseOptions) (*Database, error) {
if err = d.PartitionOffsetStatements.Prepare(d.db, d.writer, "currentstate"); err != nil {
return nil, err
}
currRoomState, err := NewSqliteCurrentRoomStateTable(d.db)
currRoomState, err := NewSqliteCurrentRoomStateTable(d.db, d.writer)
if err != nil {
return nil, err
}

View file

@ -122,7 +122,7 @@ func Open(dbProperties *config.DatabaseOptions, cache caching.RoomServerCaches)
d.Database = shared.Database{
DB: d.db,
Cache: cache,
Writer: sqlutil.NewExclusiveWriter(),
Writer: d.writer,
EventsTable: d.events,
EventTypesTable: d.eventTypes,
EventStateKeysTable: d.eventStateKeys,

View file

@ -80,7 +80,7 @@ func NewDatabase(dbProperties *config.DatabaseOptions) (*SyncServerDatasource, e
}
d.Database = shared.Database{
DB: d.db,
Writer: sqlutil.NewDummyWriter(),
Writer: d.writer,
Invites: invites,
AccountData: accountData,
OutputEvents: events,

View file

@ -93,7 +93,7 @@ func (d *SyncServerDatasource) prepare() (err error) {
}
d.Database = shared.Database{
DB: d.db,
Writer: sqlutil.NewExclusiveWriter(),
Writer: d.writer,
Invites: invites,
AccountData: accountData,
OutputEvents: events,