Skip to content

Commit

Permalink
cleaning main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
fraidev committed Jan 6, 2024
1 parent 4c5f009 commit 433f196
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ func main() {
e.Use(middleware.ProxyWithConfig(*config.ProxyConfig))

// Start metrics server
startMetricsServer(config)

// Start proxy
startProxyWithGracefulShutdown(e, config)
}

func startMetricsServer(config *config.Config) {
if config.ConfigFile.Metrics.Enabled {
go func() {
metrics := echo.New()
Expand All @@ -61,7 +68,9 @@ func main() {
}()
}

// Start proxy
}

func startProxyWithGracefulShutdown(e *echo.Echo, config *config.Config) {
go func() {
if err := e.Start(config.ConfigFile.Host); err != nil && err != http.ErrServerClosed {
e.Logger.Fatal("Shutting down the server")
Expand Down

0 comments on commit 433f196

Please sign in to comment.