From f3ab57444a73ca06f5ca366179e41870433045ae Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Tue, 24 Jul 2018 14:43:02 +0100 Subject: [PATCH] Don't close tracers multiple times --- .../dendrite/cmd/dendrite-appservice-server/main.go | 4 +--- .../dendrite/cmd/dendrite-client-api-server/main.go | 2 -- .../dendrite/cmd/dendrite-federation-api-server/main.go | 2 -- .../dendrite/cmd/dendrite-federation-sender-server/main.go | 2 -- .../matrix-org/dendrite/cmd/dendrite-media-api-server/main.go | 2 -- .../matrix-org/dendrite/cmd/dendrite-monolith-server/main.go | 2 -- .../dendrite/cmd/dendrite-public-rooms-api-server/main.go | 2 -- .../matrix-org/dendrite/cmd/dendrite-room-server/main.go | 2 -- .../matrix-org/dendrite/cmd/dendrite-sync-api-server/main.go | 2 -- 9 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/cmd/dendrite-appservice-server/main.go b/src/github.com/matrix-org/dendrite/cmd/dendrite-appservice-server/main.go index bf8cc984..f21cb107 100644 --- a/src/github.com/matrix-org/dendrite/cmd/dendrite-appservice-server/main.go +++ b/src/github.com/matrix-org/dendrite/cmd/dendrite-appservice-server/main.go @@ -25,11 +25,9 @@ func main() { cfg := basecomponent.ParseFlags() tracers := common.NewTracers(cfg) - defer tracers.Close() // nolint: errcheck - base := basecomponent.NewBaseDendrite(cfg, tracers, "AppServiceAPI") - defer base.Close() // nolint: errcheck + accountDB := base.CreateAccountsDB() deviceDB := base.CreateDeviceDB() federation := base.CreateFederationClient() diff --git a/src/github.com/matrix-org/dendrite/cmd/dendrite-client-api-server/main.go b/src/github.com/matrix-org/dendrite/cmd/dendrite-client-api-server/main.go index e42f7667..d34890bb 100644 --- a/src/github.com/matrix-org/dendrite/cmd/dendrite-client-api-server/main.go +++ b/src/github.com/matrix-org/dendrite/cmd/dendrite-client-api-server/main.go @@ -26,8 +26,6 @@ func main() { cfg := basecomponent.ParseFlags() tracers := common.NewTracers(cfg) - defer tracers.Close() // nolint: errcheck - base := basecomponent.NewBaseDendrite(cfg, tracers, "ClientAPI") defer base.Close() // nolint: errcheck diff --git a/src/github.com/matrix-org/dendrite/cmd/dendrite-federation-api-server/main.go b/src/github.com/matrix-org/dendrite/cmd/dendrite-federation-api-server/main.go index 0f69a04a..b5551af9 100644 --- a/src/github.com/matrix-org/dendrite/cmd/dendrite-federation-api-server/main.go +++ b/src/github.com/matrix-org/dendrite/cmd/dendrite-federation-api-server/main.go @@ -25,8 +25,6 @@ func main() { cfg := basecomponent.ParseFlags() tracers := common.NewTracers(cfg) - defer tracers.Close() // nolint: errcheck - base := basecomponent.NewBaseDendrite(cfg, tracers, "FederationAPI") defer base.Close() // nolint: errcheck diff --git a/src/github.com/matrix-org/dendrite/cmd/dendrite-federation-sender-server/main.go b/src/github.com/matrix-org/dendrite/cmd/dendrite-federation-sender-server/main.go index f092c549..5aead317 100644 --- a/src/github.com/matrix-org/dendrite/cmd/dendrite-federation-sender-server/main.go +++ b/src/github.com/matrix-org/dendrite/cmd/dendrite-federation-sender-server/main.go @@ -24,8 +24,6 @@ func main() { cfg := basecomponent.ParseFlags() tracers := common.NewTracers(cfg) - defer tracers.Close() // nolint: errcheck - base := basecomponent.NewBaseDendrite(cfg, tracers, "FederationSender") defer base.Close() // nolint: errcheck diff --git a/src/github.com/matrix-org/dendrite/cmd/dendrite-media-api-server/main.go b/src/github.com/matrix-org/dendrite/cmd/dendrite-media-api-server/main.go index b089a31d..54d22f25 100644 --- a/src/github.com/matrix-org/dendrite/cmd/dendrite-media-api-server/main.go +++ b/src/github.com/matrix-org/dendrite/cmd/dendrite-media-api-server/main.go @@ -24,8 +24,6 @@ func main() { cfg := basecomponent.ParseFlags() tracers := common.NewTracers(cfg) - defer tracers.Close() // nolint: errcheck - base := basecomponent.NewBaseDendrite(cfg, tracers, "MediaAPI") defer base.Close() // nolint: errcheck diff --git a/src/github.com/matrix-org/dendrite/cmd/dendrite-monolith-server/main.go b/src/github.com/matrix-org/dendrite/cmd/dendrite-monolith-server/main.go index ea94bba8..6d865d38 100644 --- a/src/github.com/matrix-org/dendrite/cmd/dendrite-monolith-server/main.go +++ b/src/github.com/matrix-org/dendrite/cmd/dendrite-monolith-server/main.go @@ -46,8 +46,6 @@ func main() { cfg := basecomponent.ParseMonolithFlags() tracers := common.NewTracers(cfg) - defer tracers.Close() // nolint: errcheck - base := basecomponent.NewBaseDendrite(cfg, tracers, "Monolith") defer base.Close() // nolint: errcheck diff --git a/src/github.com/matrix-org/dendrite/cmd/dendrite-public-rooms-api-server/main.go b/src/github.com/matrix-org/dendrite/cmd/dendrite-public-rooms-api-server/main.go index f5333337..a3d3ae01 100644 --- a/src/github.com/matrix-org/dendrite/cmd/dendrite-public-rooms-api-server/main.go +++ b/src/github.com/matrix-org/dendrite/cmd/dendrite-public-rooms-api-server/main.go @@ -24,8 +24,6 @@ func main() { cfg := basecomponent.ParseFlags() tracers := common.NewTracers(cfg) - defer tracers.Close() // nolint: errcheck - base := basecomponent.NewBaseDendrite(cfg, tracers, "PublicRoomsAPI") defer base.Close() // nolint: errcheck diff --git a/src/github.com/matrix-org/dendrite/cmd/dendrite-room-server/main.go b/src/github.com/matrix-org/dendrite/cmd/dendrite-room-server/main.go index b3e04731..72b40a61 100644 --- a/src/github.com/matrix-org/dendrite/cmd/dendrite-room-server/main.go +++ b/src/github.com/matrix-org/dendrite/cmd/dendrite-room-server/main.go @@ -26,8 +26,6 @@ func main() { cfg := basecomponent.ParseFlags() tracers := common.NewTracers(cfg) - defer tracers.Close() // nolint: errcheck - base := basecomponent.NewBaseDendrite(cfg, tracers, "RoomServerAPI") defer base.Close() // nolint: errcheck diff --git a/src/github.com/matrix-org/dendrite/cmd/dendrite-sync-api-server/main.go b/src/github.com/matrix-org/dendrite/cmd/dendrite-sync-api-server/main.go index 53bcdeb3..80cefcaa 100644 --- a/src/github.com/matrix-org/dendrite/cmd/dendrite-sync-api-server/main.go +++ b/src/github.com/matrix-org/dendrite/cmd/dendrite-sync-api-server/main.go @@ -24,8 +24,6 @@ func main() { cfg := basecomponent.ParseFlags() tracers := common.NewTracers(cfg) - defer tracers.Close() // nolint: errcheck - base := basecomponent.NewBaseDendrite(cfg, tracers, "SyncAPI") defer base.Close() // nolint: errcheck