* fix handler order in routing
#3312
* fix handler order in routing
#3312
* fix handler order in routing
#3312
* fix handler order in routing
#3312
* fix handler order in routing
#3312
---------
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
* feat: Optimize ShutdownWithContext method in app.go
- Reorder mutex lock acquisition to the start of the function
- Early return if server is not running
- Use defer for executing shutdown hooks
- Simplify nil check for hooks
- Remove TODO comment
This commit improves the readability, robustness, and execution order
of the shutdown process. It ensures consistent state throughout the
shutdown and guarantees hook execution even in error cases.
* feat: Enhance ShutdownWithContext test for improved reliability
- Add shutdown hook verification
- Implement better synchronization with channels
- Improve error handling and assertions
- Adjust timeouts for more consistent results
- Add server state check after shutdown attempt
- Include comments explaining expected behavior
This commit improves the comprehensiveness and reliability of the
ShutdownWithContext test, ensuring proper verification of shutdown
hooks, timeout behavior, and server state during long-running requests.
* 📚 Doc: update the docs to explain shutdown & hook execution order
* 🩹 Fix: Possible Data Race on shutdownHookCalled Variable
* 🩹 Fix: Remove the default Case
* 🩹 Fix: Import sync/atomic
* 🩹 Fix: golangci-lint problem
* 🎨 Style: add block in api.md
* 🩹 Fix: go mod tidy
* feat: Optimize ShutdownWithContext method in app.go
- Reorder mutex lock acquisition to the start of the function
- Early return if server is not running
- Use defer for executing shutdown hooks
- Simplify nil check for hooks
- Remove TODO comment
This commit improves the readability, robustness, and execution order
of the shutdown process. It ensures consistent state throughout the
shutdown and guarantees hook execution even in error cases.
* feat: Enhance ShutdownWithContext test for improved reliability
- Add shutdown hook verification
- Implement better synchronization with channels
- Improve error handling and assertions
- Adjust timeouts for more consistent results
- Add server state check after shutdown attempt
- Include comments explaining expected behavior
This commit improves the comprehensiveness and reliability of the
ShutdownWithContext test, ensuring proper verification of shutdown
hooks, timeout behavior, and server state during long-running requests.
* 📚 Doc: update the docs to explain shutdown & hook execution order
* 🩹 Fix: Possible Data Race on shutdownHookCalled Variable
* 🩹 Fix: Remove the default Case
* 🩹 Fix: Import sync/atomic
* 🩹 Fix: golangci-lint problem
* 🎨 Style: add block in api.md
* 🩹 Fix: go mod tidy
* ♻️ Refactor: replaced OnShutdown by OnPreShutdown and OnPostShutdown
* ♻️ Refactor: streamline post-shutdown hook execution in graceful shutdown process
* 🚨 Test: add test for gracefulShutdown
* 🔥 Feature: Using executeOnPreShutdownHooks and executeOnPostShutdownHooks Instead of OnShutdownSuccess and OnShutdownError
* 🩹 Fix: deal Listener err
* 🩹 Fix: go lint error
* 🩹 Fix: reduced memory alignment
* 🩹 Fix: reduced memory alignment
* 🩹 Fix: context should be created inside the concatenation.
* 📚 Doc: update what_new.md and hooks.md
* ♻️ Refactor: use blocking channel instead of time.Sleep
* 🩹 Fix: Improve synchronization in error propagation test.
* 🩹 Fix: Replace sleep with proper synchronization.
* 🩹 Fix: Server but not shut down properly
* 🩹 Fix: Using channels to synchronize and pass results
* 🩹 Fix: timeout with long running request
* 📚 Doc: remove OnShutdownError and OnShutdownSuccess from fiber.md
* Update hooks.md
* 🚨 Test: Add graceful shutdown timeout error test case
* 📝 Doc: Restructure hooks documentation for OnPreShutdown and OnPostShutdown
* 📝 Doc: Remove extra whitespace in hooks documentation
---------
Co-authored-by: yingjie.huang <yingjie.huang@fosunhn.net>
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
build(deps): bump golang.org/x/net in the go_modules group
Bumps the go_modules group with 1 update: [golang.org/x/net](https://github.com/golang/net).
Updates `golang.org/x/net` from 0.31.0 to 0.33.0
- [Commits](https://github.com/golang/net/compare/v0.31.0...v0.33.0)
---
updated-dependencies:
- dependency-name: golang.org/x/net
dependency-type: indirect
dependency-group: go_modules
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Update intro.md Static Files section
In v3 the apps Static method has been removed and its functionality has been moved to the static middleware.
The given code example has been updated accordingly.
* ♻️ Refactor: Extract testConn err to variable
* ♻️ Refactor: Extract ErrTestGotEmptyResponse from app.Test()
* 🩹 Fix: Fix `app.Test()` auto-failing when testConn is closed
* 🩹 Fix(app_test.go): Use tab for indent instead of spaces
* 🩹 Fix(app_test.go): Fix to respect gofmt linter
* ♻️ Refactor: Update Drop tests to verify error type
* feat(timeout): unify and enhance timeout middleware
- Combine classic context-based timeout with a Goroutine + channel approach
- Support custom error list without additional parameters
- Return fiber.ErrRequestTimeout for timeouts or listed errors
* feat(timeout): unify and enhance timeout middleware
- Combine classic context-based timeout with a Goroutine + channel approach
- Support custom error list without additional parameters
- Return fiber.ErrRequestTimeout for timeouts or listed errors
* refactor(timeout): remove goroutine-based logic and improve documentation
- Switch to a synchronous approach to avoid data races with fasthttp context
- Enhance error handling for deadline and custom errors
- Update comments for clarity and maintainability
* refactor(timeout): add more test cases and handle zero duration case
* refactor(timeout): add more test cases and handle zero duration case
* refactor(timeout): add more test cases and handle zero duration case
---------
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>