Skip to content

Commit

Permalink
Fix: Skip random number generation for single endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
har23k committed Oct 21, 2024
1 parent 5d7198f commit 869b83b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions monolake-services/src/http/handlers/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ where
Ok(route) => {
let route = route.value;
tracing::info!("the route id: {}", route.id);
if route.upstreams.len() == 1 {
rewrite_request(&mut request, &route.upstreams[0]);
return self.inner.handle(request, ctx).await;
}
use rand::seq::SliceRandom;
let upstream = route
.upstreams
Expand Down

0 comments on commit 869b83b

Please sign in to comment.