Skip to content

Commit

Permalink
update readme, remove unnecessary vec conversion (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdockerty committed Dec 3, 2023
1 parent c883cc2 commit 1abbc55
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 16 deletions.
9 changes: 0 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dashmap = "5.5.3"
log = "0.4.20"
once_cell = "1.18.0"
rand = "0.8.5"
reqwest = { version = "0.11.22", features = ["blocking"] }
reqwest = { version = "0.11.22" }
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
serde_yaml = "0.9.25"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Hello from fake-2

- Round-robin load balancing of HTTP/TCP connections.
- Health checks for HTTP/TCP targets.
- Graceful termination.

## Performance

Expand Down
4 changes: 1 addition & 3 deletions src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,15 @@ impl Proxy for HttpProxy {

async fn proxy(mut connection: Connection, routing_idx: Arc<RwLock<usize>>) -> Result<()> {
if let Some(backends) = connection.targets.get(&connection.target_name) {
let backends = backends.to_vec();
debug!("Backends configured {:?}", &backends);
let backend_count = backends.len();

if backend_count == 0 {
info!(
"[HTTP] No routable backends for {}, nothing to do",
&connection.target_name
);
return Ok(());
}
debug!("Backends configured {:?}", &backends);

// Limit the scope of the index write lock.
let http_backend: String;
Expand Down
4 changes: 1 addition & 3 deletions src/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,15 @@ impl Proxy for TcpProxy {

async fn proxy(mut connection: Connection, routing_idx: Arc<RwLock<usize>>) -> Result<()> {
if let Some(backends) = connection.targets.get(&connection.target_name) {
let backends = backends.to_vec();
debug!("Backends configured {:?}", &backends);
let backend_count = backends.len();

if backend_count == 0 {
info!(
"[TCP] No routable backends for {}, nothing to do",
&connection.target_name
);
return Ok(());
}
debug!("Backends configured {:?}", &backends);

// Limit the scope of the index write lock.
let backend_addr: String;
Expand Down

0 comments on commit 1abbc55

Please sign in to comment.