Skip to content

Commit

Permalink
reversable fud v4
Browse files Browse the repository at this point in the history
  • Loading branch information
mariari committed Nov 3, 2023
1 parent e05962e commit 6906d25
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,15 @@ where
match listener_clone.accept().await {
Ok((socket, _addr)) => {
if let Err(e) = conn.clone().run(socket).await {

match e.downcast::<tower::load_shed::error::Overloaded>() {
Err(e) => {
tracing::error!({ %e }, "error in a connection handler");
return Err(backoff::Error::Permanent(e))
}
Ok(e) => {
tracing::warn!("Service overloaded - backing off");
return Err(backoff::Error::transient(e));
return Err(backoff::Error::transient(e))
}
}
} else {
Expand All @@ -200,7 +201,7 @@ where
}
}
}
).await;
);
});
}
}
Expand Down

0 comments on commit 6906d25

Please sign in to comment.