diff options
author | Kegsay <kegan@matrix.org> | 2020-06-15 16:58:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-15 16:58:22 +0100 |
commit | 67ad6618139a495a80800a2145d9ba319c5d0c5d (patch) | |
tree | 68f72f23ba3f902b2cd128d29ba6c4c7856079bd /cmd/dendrite-monolith-server | |
parent | 7c36fb78a729dcce174a5d1e577edeeeb9ca806d (diff) |
Unbreak HTTP mode (#1131)
Diffstat (limited to 'cmd/dendrite-monolith-server')
-rw-r--r-- | cmd/dendrite-monolith-server/main.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd/dendrite-monolith-server/main.go b/cmd/dendrite-monolith-server/main.go index d7b0bf48..3a0a84ef 100644 --- a/cmd/dendrite-monolith-server/main.go +++ b/cmd/dendrite-monolith-server/main.go @@ -74,11 +74,13 @@ func main() { } keyRing := serverKeyAPI.KeyRing() - rsAPI := roomserver.NewInternalAPI( + rsImpl := roomserver.NewInternalAPI( base, keyRing, federation, ) + // call functions directly on the impl unless running in HTTP mode + rsAPI := rsImpl if base.UseHTTPAPIs { - roomserver.AddInternalRoutes(base.InternalAPIMux, rsAPI) + roomserver.AddInternalRoutes(base.InternalAPIMux, rsImpl) rsAPI = base.RoomserverHTTPClient() } if traceInternal { @@ -108,7 +110,9 @@ func main() { federationsender.AddInternalRoutes(base.InternalAPIMux, fsAPI) fsAPI = base.FederationSenderHTTPClient() } - rsAPI.SetFederationSenderAPI(fsAPI) + // The underlying roomserver implementation needs to be able to call the fedsender. + // This is different to rsAPI which can be the http client which doesn't need this dependency + rsImpl.SetFederationSenderAPI(fsAPI) publicRoomsDB, err := storage.NewPublicRoomsServerDatabase(string(base.Cfg.Database.PublicRoomsAPI), base.Cfg.DbProperties(), cfg.Matrix.ServerName) if err != nil { |