Fix lint errors

This commit is contained in:
Neil Alexander 2022-05-03 12:51:22 +01:00
parent 7abaada35e
commit 7a805e16d5
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 5 additions and 2 deletions

View file

@ -108,6 +108,9 @@ func main() {
0, // TODO
cfg.Global.ServerNotices.LocalPart,
)
if err != nil {
logrus.WithError(err).Fatalln("Failed to connect to the database")
}
accType := api.AccountTypeUser
if *isAdmin {

View file

@ -39,7 +39,7 @@ type Database struct {
func Open(base *base.BaseDendrite, dbProperties *config.DatabaseOptions, cache caching.RoomServerCaches) (*Database, error) {
var d Database
var err error
db, writer, err := base.DatabaseConnection(dbProperties, sqlutil.NewDummyWriter())
db, writer, err := base.DatabaseConnection(dbProperties, sqlutil.NewExclusiveWriter())
if err != nil {
return nil, fmt.Errorf("sqlutil.Open: %w", err)
}
@ -176,7 +176,7 @@ func (d *Database) prepare(db *sql.DB, writer sqlutil.Writer, cache caching.Room
d.Database = shared.Database{
DB: db,
Cache: cache,
Writer: sqlutil.NewExclusiveWriter(),
Writer: writer,
EventsTable: events,
EventTypesTable: eventTypes,
EventStateKeysTable: eventStateKeys,