1
0
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:
wernerr 2020-06-21 15:16:41 +02:00
parent 58df347197
commit cf4e2bbcdd

View File

@ -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{}{}: