Skip to content

Commit 430c865

Browse files
TuntiiCopilot
andauthored
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent cdbcef7 commit 430c865

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/cookbook/src/recipes/resilience.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ In RustAPI (Tower) middleware, layers wrap around each other. The order you call
113113

114114
```rust
115115
let app = RustApi::new()
116-
// 3. Timeout (applies to the whole operation)
117-
.layer(TimeoutLayer::from_secs(10))
118-
// 2. Circuit Breaker (protects upstream)
119-
.layer(CircuitBreakerLayer::new())
120116
// 1. Retry (handles transient errors)
121117
.layer(RetryLayer::new())
118+
// 2. Circuit Breaker (protects upstream)
119+
.layer(CircuitBreakerLayer::new())
120+
// 3. Timeout (applies to the whole operation)
121+
.layer(TimeoutLayer::from_secs(10))
122122
.route("/", get(handler));
123123
```

0 commit comments

Comments
 (0)