Skip to content

no signal capture #26

@jerry-pond

Description

@jerry-pond

Description

after I wraped gin.Handler(), the program didnot not reponse to CTRL +C/D


func RunWithDebugDashboard(r *gin.Engine, addr string) error {
	handler := govisual.Wrap(
		r,
		govisual.WithRequestBodyLogging(true),  // Log request bodies
		govisual.WithResponseBodyLogging(true), // Log response bodies
	)
	fmt.Printf("Listening and serving HTTP on %s\n", addr)
	fmt.Printf("debug dashboard on %s/__viz/\n", addr)
	return http.ListenAndServe(addr, handler)
}

RunWithDebugDashboard(r, addr)
if err := r.Run(fmt.Sprintf(":%d", config.AppConfig.ApiPort)); err != nil {
		logger.Error("run server returns error", zap.Error(err))
	}

I'm not sure if gin engine did something for system signal, could you provider a http middleware instead of wraphandle

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions