Function
timeout_10secs
(
req: dev::ServiceRequest,
next: Next<impl MessageBody + 'static>,
)
Source from the content-addressed store, hash-verified
| 15 | mod simple; |
| 16 | |
| 17 | async fn timeout_10secs( |
| 18 | req: dev::ServiceRequest, |
| 19 | next: Next<impl MessageBody + 'static>, |
| 20 | ) -> Result<dev::ServiceResponse<impl MessageBody>, Error> { |
| 21 | match time::timeout(Duration::from_secs(10), next.call(req)).await { |
| 22 | Ok(res) => res, |
| 23 | Err(_err) => Err(actix_web::error::ErrorRequestTimeout("")), |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | #[actix_web::main] |
| 28 | async fn main() -> std::io::Result<()> { |
Callers
nothing calls this directly
Tested by
no test coverage detected