mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-23 21:24:02 +00:00
improve timeout middleware
This commit is contained in:
parent
58df347197
commit
cf4e2bbcdd
@ -15,6 +15,7 @@ func Timeout(handler fiber.Handler, timeout time.Duration) fiber.Handler {
|
||||
return handler
|
||||
}
|
||||
|
||||
// logic is from fasthttp.TimeoutWithCodeHandler https://github.com/valyala/fasthttp/blob/master/server.go#L418
|
||||
return func(ctx *fiber.Ctx) {
|
||||
select {
|
||||
case concurrencyCh <- struct{}{}:
|
||||
|
Loading…
x
Reference in New Issue
Block a user