aboutsummaryrefslogtreecommitdiff
path: root/federationsender/storage/storage.go
diff options
context:
space:
mode:
Diffstat (limited to 'federationsender/storage/storage.go')
-rw-r--r--federationsender/storage/storage.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/federationsender/storage/storage.go b/federationsender/storage/storage.go
index f3613822..5462c352 100644
--- a/federationsender/storage/storage.go
+++ b/federationsender/storage/storage.go
@@ -21,16 +21,17 @@ import (
"github.com/matrix-org/dendrite/federationsender/storage/postgres"
"github.com/matrix-org/dendrite/federationsender/storage/sqlite3"
+ "github.com/matrix-org/dendrite/internal/caching"
"github.com/matrix-org/dendrite/setup/config"
)
// NewDatabase opens a new database
-func NewDatabase(dbProperties *config.DatabaseOptions) (Database, error) {
+func NewDatabase(dbProperties *config.DatabaseOptions, cache caching.FederationSenderCache) (Database, error) {
switch {
case dbProperties.ConnectionString.IsSQLite():
- return sqlite3.NewDatabase(dbProperties)
+ return sqlite3.NewDatabase(dbProperties, cache)
case dbProperties.ConnectionString.IsPostgres():
- return postgres.NewDatabase(dbProperties)
+ return postgres.NewDatabase(dbProperties, cache)
default:
return nil, fmt.Errorf("unexpected database type")
}