From 338cdc2eb8cefb27ae7e868c8e448830f108c4b2 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Wed, 30 Apr 2025 17:50:14 +0200 Subject: [PATCH] Tiny fix. --- kvrouter/src/main.rs | 8 ++++---- kvrouter/src/trie.rs | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/kvrouter/src/main.rs b/kvrouter/src/main.rs index b5081545..2cb1c915 100644 --- a/kvrouter/src/main.rs +++ b/kvrouter/src/main.rs @@ -9,16 +9,13 @@ async fn main() { // List of backend servers let backends = vec![ "http://localhost:8000".to_string(), - // "http://localhost:8001".to_string(), + "http://localhost:8001".to_string(), // "http://localhost:8002".to_string(), // "http://localhost:8003".to_string(), ]; // Create a new instance of the RoundRobinRouter - println!("Using Content aware"); - // Create the Axum router - let (sx, rx) = tokio::sync::mpsc::channel(100); let communicator = Communicator::new(sx); tokio::task::spawn(async move { @@ -28,6 +25,9 @@ async fn main() { let mut router = OverloadHandler::new(lb, backends, rx); router.run().await; } else { + println!("Using Content aware"); + // Create the Axum router + let lb = ContentAware::new(); let mut router = OverloadHandler::new(lb, backends, rx); router.run().await; diff --git a/kvrouter/src/trie.rs b/kvrouter/src/trie.rs index 8062af60..691df357 100644 --- a/kvrouter/src/trie.rs +++ b/kvrouter/src/trie.rs @@ -124,6 +124,7 @@ impl Node { } #[cfg(debug_assertions)] + #[allow(dead_code)] fn remove(&mut self, data: &[u8]) -> Result<(), Error> { // TODO reclaim the nodes too. let mismatch = mismatch(data, &self.content); @@ -155,7 +156,7 @@ impl Trie { self.root.insert(data) } - // TODO + #[cfg(debug_assertions)] #[allow(dead_code)] pub fn remove(&mut self, data: &[u8]) -> Result<(), Error> { self.root.remove(data)