diff options
author | Kegsay <kegan@matrix.org> | 2021-03-08 13:19:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-08 13:19:02 +0000 |
commit | 850abb1dde2ce6f85554457e3ee94a9837e13897 (patch) | |
tree | 4b9068e9e4bca77ac1be1291c10fc53d8a704648 /userapi/storage/accounts/storage.go | |
parent | c3ad2cca49a7ad5890dddf2d8eec3e3cbbff16d1 (diff) |
Make bcrypt cost configurable (#1793)
Diffstat (limited to 'userapi/storage/accounts/storage.go')
-rw-r--r-- | userapi/storage/accounts/storage.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/userapi/storage/accounts/storage.go b/userapi/storage/accounts/storage.go index 3f69e95f..28c437da 100644 --- a/userapi/storage/accounts/storage.go +++ b/userapi/storage/accounts/storage.go @@ -27,12 +27,12 @@ import ( // NewDatabase opens a new Postgres or Sqlite database (based on dataSourceName scheme) // and sets postgres connection parameters -func NewDatabase(dbProperties *config.DatabaseOptions, serverName gomatrixserverlib.ServerName) (Database, error) { +func NewDatabase(dbProperties *config.DatabaseOptions, serverName gomatrixserverlib.ServerName, bcryptCost int) (Database, error) { switch { case dbProperties.ConnectionString.IsSQLite(): - return sqlite3.NewDatabase(dbProperties, serverName) + return sqlite3.NewDatabase(dbProperties, serverName, bcryptCost) case dbProperties.ConnectionString.IsPostgres(): - return postgres.NewDatabase(dbProperties, serverName) + return postgres.NewDatabase(dbProperties, serverName, bcryptCost) default: return nil, fmt.Errorf("unexpected database type") } |