From 6b537c956b45f53637267fc4ae6c673697071e55 Mon Sep 17 00:00:00 2001 From: Jannis Mattheis Date: Sun, 18 Mar 2018 16:04:33 +0100 Subject: [PATCH] Move https server in go func to not block http server --- runner/runner.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runner/runner.go b/runner/runner.go index 22df428..3db9a9b 100644 --- a/runner/runner.go +++ b/runner/runner.go @@ -38,7 +38,9 @@ func Run(engine *gin.Engine, conf *config.Configuration) { s.TLSConfig = &tls.Config{GetCertificate: certManager.GetCertificate} } fmt.Println("Started Listening on port", conf.Server.SSL.Port) - go log.Fatal(s.ListenAndServeTLS(conf.Server.SSL.CertFile, conf.Server.SSL.CertKey)) + go func() { + log.Fatal(s.ListenAndServeTLS(conf.Server.SSL.CertFile, conf.Server.SSL.CertKey)) + }() } fmt.Println("Started Listening on port", conf.Server.Port) log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", conf.Server.Port), httpHandler))