Skip to content

Commit

Permalink
Remove init() methods from OM servers since they aren't needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyje authored and joeholley committed Feb 27, 2019
1 parent b5367ea commit 15ea999
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 27 deletions.
4 changes: 0 additions & 4 deletions cmd/backendapi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ import (
"github.com/GoogleCloudPlatform/open-match/internal/app/backendapi"
)

func init() {
backendapi.InitializeApplication()
}

func main() {
backendapi.RunApplication()
}
4 changes: 0 additions & 4 deletions cmd/frontendapi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ import (
"github.com/GoogleCloudPlatform/open-match/internal/app/frontendapi"
)

func init() {
frontendapi.InitializeApplication()
}

func main() {
frontendapi.RunApplication()
}
4 changes: 0 additions & 4 deletions cmd/mmforc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ import (
"github.com/GoogleCloudPlatform/open-match/internal/app/mmforc"
)

func init() {
mmforc.InitializeApplication()
}

func main() {
mmforc.RunApplication()
}
4 changes: 0 additions & 4 deletions cmd/mmlogicapi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ import (
"github.com/GoogleCloudPlatform/open-match/internal/app/mmlogicapi"
)

func init() {
mmlogicapi.InitializeApplication()
}

func main() {
mmlogicapi.RunApplication()
}
6 changes: 3 additions & 3 deletions internal/app/backendapi/backendapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ var (
err = errors.New("")
)

// InitializeApplication is a hook for the init() method in the main executable.
func InitializeApplication() {
func initializeApplication() {
// Add a hook to the logger to auto-count log lines for metrics output thru OpenCensus
log.AddHook(metrics.NewHook(apisrv.BeLogLines, apisrv.KeySeverity))

Expand Down Expand Up @@ -82,7 +81,8 @@ func InitializeApplication() {

// RunApplication is a hook for the main() method in the main executable.
func RunApplication() {

initializeApplication()

// Connect to redis
pool := redishelpers.ConnectionPool(cfg)
defer pool.Close()
Expand Down
6 changes: 3 additions & 3 deletions internal/app/frontendapi/frontendapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ var (
err = errors.New("")
)

// InitializeApplication is a hook for the init() method in the main executable.
func InitializeApplication() {
func initializeApplication() {
// Add a hook to the logger to auto-count log lines for metrics output thru OpenCensus
log.AddHook(metrics.NewHook(apisrv.FeLogLines, apisrv.KeySeverity))

Expand Down Expand Up @@ -84,7 +83,8 @@ func InitializeApplication() {

// RunApplication is a hook for the main() method in the main executable.
func RunApplication() {

initializeApplication()

// Connect to redis
pool := redishelpers.ConnectionPool(cfg)
defer pool.Close()
Expand Down
5 changes: 3 additions & 2 deletions internal/app/mmforc/mmforc.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ var (
err = errors.New("")
)

// InitializeApplication is a hook for the init() method in the main executable.
func InitializeApplication() {
func initializeApplication() {
// Add a hook to the logger to auto-count log lines for metrics output thru OpenCensus
log.AddHook(metrics.NewHook(MmforcLogLines, KeySeverity))

Expand Down Expand Up @@ -104,6 +103,8 @@ func InitializeApplication() {

// RunApplication is a hook for the main() method in the main executable.
func RunApplication() {
initializeApplication()

pool := redisHelpers.ConnectionPool(cfg)
redisConn := pool.Get()
defer redisConn.Close()
Expand Down
6 changes: 3 additions & 3 deletions internal/app/mmlogicapi/mmlogicapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ var (
err = errors.New("")
)

// InitializeApplication is a hook for the init() method in the main executable.
func InitializeApplication() {
func initializeApplication() {
// Logrus structured logging initialization
// Add a hook to the logger to auto-count log lines for metrics output thru OpenCensus
log.AddHook(metrics.NewHook(apisrv.MlLogLines, apisrv.KeySeverity))
Expand Down Expand Up @@ -83,7 +82,8 @@ func InitializeApplication() {

// RunApplication is a hook for the main() method in the main executable.
func RunApplication() {

initializeApplication()

// Connect to redis
pool := redisHelpers.ConnectionPool(cfg)
defer pool.Close()
Expand Down

0 comments on commit 15ea999

Please sign in to comment.