Skip to content

Commit

Permalink
Merge pull request #885 from Fenny/master
Browse files Browse the repository at this point in the history
📦 prepare v2.0.6
  • Loading branch information
Fenny authored Oct 5, 2020
2 parents 748001b + c6a08d9 commit b6e8e7c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ go get github.com/gofiber/fiber/v2
- Translated in [15 languages](https://docs.gofiber.io/)
- And much more, [explore Fiber](https://docs.gofiber.io/)


## 💡 Philosophy

New gophers that make the switch from [Node.js](https://nodejs.org/en/about/) to [Go](https://golang.org/doc/) are dealing with a learning curve before they can start building their web applications or microservices. Fiber, as a **web framework**, was created with the idea of **minimalism** and follows the **UNIX way**, so that new gophers can quickly enter the world of Go with a warm and trusted welcome.
Expand Down
2 changes: 1 addition & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
)

// Version of current fiber package
const Version = "2.0.5"
const Version = "2.0.6"

// Map is a shortcut for map[string]interface{}, useful for JSON returns
type Map map[string]interface{}
Expand Down
8 changes: 8 additions & 0 deletions middleware/timeout/timeout.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
package timeout

import (
"fmt"
"sync"
"time"

"github.com/gofiber/fiber/v2"
)

var once sync.Once

// New wraps a handler and aborts the process of the handler if the timeout is reached
func New(handler fiber.Handler, timeout time.Duration) fiber.Handler {
once.Do(func() {
fmt.Println("[Warning] timeout contains data race issues, not ready for production!")
})

if timeout <= 0 {
return handler
}
Expand Down

0 comments on commit b6e8e7c

Please sign in to comment.