works again!

This commit is contained in:
Jeffrey Paul 2019-11-08 21:35:45 -08:00
parent 297b8f4e1a
commit 10a2e7723d
2 changed files with 8 additions and 2 deletions

View File

@ -26,11 +26,14 @@ func main() {
wg.Add(1)
go func() {
ms := merp.NewMerpServer()
log.Info().Msg("calling serveforever")
ms.ServeForever()
log.Info().Msg("back from serveforever")
wg.Done()
}()
wg.Wait()
log.Info().Msg("done waiting on waitgroup")
}
func identify() {

View File

@ -55,7 +55,7 @@ func (ms *MerpServer) init() {
ms.setupRoutes()
ms.server = &http.Server{
Addr: fmt.Sprintf(":%s", ms.port),
Addr: fmt.Sprintf(":%d", ms.port),
Handler: ms.gin,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
@ -69,7 +69,10 @@ func (ms *MerpServer) connectDB() {
// ServeForever causes merp to serve http forever
func (ms *MerpServer) ServeForever() {
ms.server.ListenAndServe()
err := ms.server.ListenAndServe()
if err != nil {
panic(err)
}
}
func (ms *MerpServer) HealthCheckHandler() http.HandlerFunc {