Closed godsoul closed 1 year ago
Hertz Server does not use context to control the timeout of requests. It provides write_timeout and read_timeout configurations.
I think this could provide a timeout middleware that would help the business use context to control the timeout but we need to know that there is nothing we can do to stop the goroutine from continuing to execute even if we control the timeout. refer to https://github.com/valyala/fasthttp/issues/1447
I want hetz context -> gorm WithContext -> redis context, but i got hertz context is context.Background(),no set timeout.
It is available to set it according to your business logic through a middleware, and pass it through your third part SDKs. More info: https://www.cloudwego.io/docs/hertz/tutorials/basic-feature/middleware/
Please assign me.
Please assign me.
thanks
Please assign it to me
当hertz做服务端的时候,客户端没传context,可以给context.Context设置个默认超时时间。