aboutsummaryrefslogtreecommitdiff
path: root/setup/monolith.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-05-03 16:35:06 +0100
committerGitHub <noreply@github.com>2022-05-03 16:35:06 +0100
commit4ad5f9c982fe5dc9e306a9269621ead8c31248cf (patch)
tree9eac975c1d7232b35ce4d0c7f658db3c2289f0ab /setup/monolith.go
parent979a551f1e2aeb9f3417df5e52a7279230b7a3ba (diff)
Global database connection pool (for monolith mode) (#2411)
* Allow monolith components to share a single database pool * Don't yell about missing connection strings * Rename field * Setup tweaks * Fix panic * Improve configuration checks * Update config * Fix lint errors * Update comments
Diffstat (limited to 'setup/monolith.go')
-rw-r--r--setup/monolith.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/setup/monolith.go b/setup/monolith.go
index c86ec7b6..a414172c 100644
--- a/setup/monolith.go
+++ b/setup/monolith.go
@@ -25,11 +25,10 @@ import (
keyAPI "github.com/matrix-org/dendrite/keyserver/api"
"github.com/matrix-org/dendrite/mediaapi"
roomserverAPI "github.com/matrix-org/dendrite/roomserver/api"
+ "github.com/matrix-org/dendrite/setup/base"
"github.com/matrix-org/dendrite/setup/config"
- "github.com/matrix-org/dendrite/setup/process"
"github.com/matrix-org/dendrite/syncapi"
userapi "github.com/matrix-org/dendrite/userapi/api"
- userdb "github.com/matrix-org/dendrite/userapi/storage"
"github.com/matrix-org/gomatrixserverlib"
)
@@ -37,7 +36,6 @@ import (
// all components of Dendrite, for use in monolith mode.
type Monolith struct {
Config *config.Dendrite
- AccountDB userdb.Database
KeyRing *gomatrixserverlib.KeyRing
Client *gomatrixserverlib.Client
FedClient *gomatrixserverlib.FederationClient
@@ -54,26 +52,28 @@ type Monolith struct {
}
// AddAllPublicRoutes attaches all public paths to the given router
-func (m *Monolith) AddAllPublicRoutes(process *process.ProcessContext, csMux, ssMux, keyMux, wkMux, mediaMux, synapseMux, dendriteMux *mux.Router) {
+func (m *Monolith) AddAllPublicRoutes(base *base.BaseDendrite, csMux, ssMux, keyMux, wkMux, mediaMux, synapseMux, dendriteMux *mux.Router) {
userDirectoryProvider := m.ExtUserDirectoryProvider
if userDirectoryProvider == nil {
userDirectoryProvider = m.UserAPI
}
clientapi.AddPublicRoutes(
- process, csMux, synapseMux, dendriteMux, &m.Config.ClientAPI,
- m.FedClient, m.RoomserverAPI,
- m.AppserviceAPI, transactions.New(),
+ base.ProcessContext, csMux, synapseMux, dendriteMux, &m.Config.ClientAPI,
+ m.FedClient, m.RoomserverAPI, m.AppserviceAPI, transactions.New(),
m.FederationAPI, m.UserAPI, userDirectoryProvider, m.KeyAPI,
m.ExtPublicRoomsProvider, &m.Config.MSCs,
)
federationapi.AddPublicRoutes(
- process, ssMux, keyMux, wkMux, &m.Config.FederationAPI, m.UserAPI, m.FedClient,
- m.KeyRing, m.RoomserverAPI, m.FederationAPI,
+ base.ProcessContext, ssMux, keyMux, wkMux, &m.Config.FederationAPI,
+ m.UserAPI, m.FedClient, m.KeyRing, m.RoomserverAPI, m.FederationAPI,
m.KeyAPI, &m.Config.MSCs, nil,
)
- mediaapi.AddPublicRoutes(mediaMux, &m.Config.MediaAPI, &m.Config.ClientAPI.RateLimiting, m.UserAPI, m.Client)
+ mediaapi.AddPublicRoutes(
+ base, mediaMux, &m.Config.MediaAPI, &m.Config.ClientAPI.RateLimiting,
+ m.UserAPI, m.Client,
+ )
syncapi.AddPublicRoutes(
- process, csMux, m.UserAPI, m.RoomserverAPI,
+ base, csMux, m.UserAPI, m.RoomserverAPI,
m.KeyAPI, m.FedClient, &m.Config.SyncAPI,
)
}