Use userImpl for AS (annoying)

This commit is contained in:
Neil Alexander 2021-11-02 17:26:31 +00:00
parent 51ba578f96
commit 540681c278
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -117,7 +117,8 @@ func main() {
keyAPI = base.KeyServerHTTPClient()
}
userAPI := userapi.NewInternalAPI(accountDB, &cfg.UserAPI, cfg.Derived.ApplicationServices, keyAPI)
userImpl := userapi.NewInternalAPI(accountDB, &cfg.UserAPI, cfg.Derived.ApplicationServices, keyAPI)
userAPI := userImpl
if base.UseHTTPAPIs {
userapi.AddInternalRoutes(base.InternalAPIMux, userAPI)
userAPI = base.UserAPIClient()
@ -128,7 +129,10 @@ func main() {
}
}
asAPI := appservice.NewInternalAPI(base, userAPI, rsAPI)
// TODO: This should use userAPI, not userImpl, but the appservice setup races with
// the listeners and panics at startup if it tries to create appservice accounts
// before the listeners are up.
asAPI := appservice.NewInternalAPI(base, userImpl, rsAPI)
if base.UseHTTPAPIs {
appservice.AddInternalRoutes(base.InternalAPIMux, asAPI)
asAPI = base.AppserviceHTTPClient()