Skip to content

feat: timeout handler middleware#121

Merged
ahmadbky merged 8 commits intomasterfrom
feat-mw-timeout
Mar 7, 2026
Merged

feat: timeout handler middleware#121
ahmadbky merged 8 commits intomasterfrom
feat-mw-timeout

Conversation

@ahmadbky
Copy link
Copy Markdown
Member

@ahmadbky ahmadbky commented Mar 7, 2026

  • Add the middleware for the request timeout. Make it configurable with custom durations and handlers in case of timeout.
  • Add configuration environment variables for the timeout used by the middleware for the endpoints, and another for the URL of the Discord webhook.
  • Add unit tests.
  • Wrap this middleware for the main server before wrapping the TracingLogger.

ahmadbky added 4 commits March 7, 2026 14:08
* Add the middleware for the request timeout. Make it configurable with
  custom durations and handlers in case of timeout.
* Add configuration environment variables for the timeout used by the
  middleware for the endpoints, and another for the URL of the Discord
  webhook.
* Add unit tests.
* Wrap this middleware for the main server before wrapping the
  `TracingLogger`.
@ahmadbky ahmadbky marked this pull request as ready for review March 7, 2026 14:08
@ahmadbky ahmadbky requested a review from Copilot March 7, 2026 14:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a configurable request-timeout notification middleware to the game-api Actix server, with tracing + Discord webhook handlers and accompanying configuration/tests.

Changes:

  • Introduce RequestTimeoutNotifier middleware and timeout handlers (tracing + webhook) with unit tests.
  • Add env configuration for request timeout duration and the timeout-warning Discord webhook URL.
  • Wire the middleware into the server stack and update dependencies / CI Rust toolchain.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
crates/game_api/src/main.rs Registers the timeout notifier middleware in the Actix middleware chain.
crates/game_api/src/env.rs Adds REQUEST_TIMEOUT_MS and WEBHOOK_REQUEST_TIMEOUT configuration entries.
crates/game_api/src/configure/slow_req_mw.rs Implements the timeout notifier middleware, handlers, and unit tests.
crates/game_api/src/configure.rs Exposes the new slow_req_mw module.
crates/game_api/Cargo.toml Makes pin-project-lite a non-optional dependency and adjusts feature wiring.
.github/workflows/docs.yml Bumps the Rust toolchain version used for docs workflow.
.github/workflows/ci.yml Bumps the Rust toolchain version used for CI workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ahmadbky ahmadbky merged commit 751098e into master Mar 7, 2026
7 checks passed
@ahmadbky ahmadbky deleted the feat-mw-timeout branch March 7, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants