Skip to content

Commit

Permalink
feat: file exist
Browse files Browse the repository at this point in the history
  • Loading branch information
FGYFFFF committed Aug 4, 2023
1 parent 83c0b3d commit 3b9f22c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/server/kitex.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,18 +321,18 @@ func (t *transHandler) OnRead(ctx context.Context, conn net.Conn) error {
}
func initHertz() *route.Engine {
h := hertzServer.New()
h := hertzServer.New(hertzServer.WithIdleTimeout(0))
// add a ping route to test
h.GET("/ping", func(c context.Context, ctx *app.RequestContext) {
ctx.JSON(consts.StatusOK, utils.H{"ping": "pong"})
})
router.GeneratedRegister(h)
err := h.Engine.Init()
if err != nil {
if err := h.Engine.Init(); err != nil {
panic(err)
}
//if err := h.Engine.SetEngineRun(); err != nil {
// panic(err)
//}
return h.Engine
}
Expand All @@ -343,6 +343,9 @@ func init() {
}
`
if util.Exists("hex_trans_handler.go") {
return nil
}
tmpl := template.Must(template.New("hex_trans_handler").Parse(tmplContent))
file, err := os.Create("hex_trans_handler.go")
if err != nil {
Expand Down

0 comments on commit 3b9f22c

Please sign in to comment.