aboutsummaryrefslogtreecommitdiff
path: root/userapi/storage/accounts/storage.go
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2021-03-08 13:19:02 +0000
committerGitHub <noreply@github.com>2021-03-08 13:19:02 +0000
commit850abb1dde2ce6f85554457e3ee94a9837e13897 (patch)
tree4b9068e9e4bca77ac1be1291c10fc53d8a704648 /userapi/storage/accounts/storage.go
parentc3ad2cca49a7ad5890dddf2d8eec3e3cbbff16d1 (diff)
Make bcrypt cost configurable (#1793)
Diffstat (limited to 'userapi/storage/accounts/storage.go')
-rw-r--r--userapi/storage/accounts/storage.go6
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")
}