From 909c809876c066904b2e4d8d811167d83dbbba3f Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Mon, 29 Aug 2022 10:20:28 +0200 Subject: [PATCH] Revert "Fix race condition on startup" This reverts commit 37905f81e63a9935d9c3def18bc5e5d16b34fd93. --- cmd/dendrite-monolith-server/main.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/cmd/dendrite-monolith-server/main.go b/cmd/dendrite-monolith-server/main.go index e7eebeb29..845b9e465 100644 --- a/cmd/dendrite-monolith-server/main.go +++ b/cmd/dendrite-monolith-server/main.go @@ -18,8 +18,6 @@ import ( "flag" "os" - "github.com/sirupsen/logrus" - "github.com/matrix-org/dendrite/appservice" "github.com/matrix-org/dendrite/federationapi" "github.com/matrix-org/dendrite/keyserver" @@ -31,6 +29,7 @@ import ( "github.com/matrix-org/dendrite/setup/mscs" "github.com/matrix-org/dendrite/userapi" uapi "github.com/matrix-org/dendrite/userapi/api" + "github.com/sirupsen/logrus" _ "github.com/mattn/go-sqlite3" ) @@ -156,6 +155,14 @@ func main() { } } + // Expose the matrix APIs directly rather than putting them under a /api path. + go func() { + base.SetupAndServeHTTP( + httpAPIAddr, // internal API + httpAddr, // external API + nil, nil, // TLS settings + ) + }() // Handle HTTPS if certificate and key are provided if *certFile != "" && *keyFile != "" { go func() { @@ -165,15 +172,6 @@ func main() { certFile, keyFile, // TLS settings ) }() - } else { - // Expose the matrix APIs directly rather than putting them under a /api path. - go func() { - base.SetupAndServeHTTP( - httpAPIAddr, // internal API - httpAddr, // external API - nil, nil, // TLS settings - ) - }() } // We want to block forever to let the HTTP and HTTPS handler serve the APIs