Skip to content

Commit

Permalink
chore: Move network services to services flags. (#1074)
Browse files Browse the repository at this point in the history
  • Loading branch information
XAMPPRocky committed Jan 22, 2025
1 parent 588a4ca commit 9828536
Show file tree
Hide file tree
Showing 10 changed files with 485 additions and 49 deletions.
2 changes: 0 additions & 2 deletions crates/test/tests/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ trace_test!(uring_receiver, {
),
}
.spawn(pending_sends)
.await
.expect("failed to spawn task");

// Drop the socket, otherwise it can
Expand Down Expand Up @@ -161,7 +160,6 @@ trace_test!(
&sessions,
BUFFER_POOL.clone(),
)
.await
.unwrap();

let socket = std::sync::Arc::new(sb.client());
Expand Down
7 changes: 6 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use strum_macros::{Display, EnumString};

pub use self::{
agent::Agent, generate_config_schema::GenerateConfigSchema, manage::Manage, proxy::Proxy,
qcmp::Qcmp, relay::Relay,
qcmp::Qcmp, relay::Relay, service::Service,
};

macro_rules! define_port {
Expand All @@ -47,6 +47,7 @@ pub mod manage;
pub mod proxy;
pub mod qcmp;
pub mod relay;
mod service;

const ETC_CONFIG_PATH: &str = "/etc/quilkin/quilkin.yaml";
const PORT_ENV_VAR: &str = "QUILKIN_PORT";
Expand Down Expand Up @@ -121,6 +122,8 @@ pub struct Cli {
pub admin: AdminCli,
#[command(flatten)]
pub locality: LocalityCli,
#[command(flatten)]
pub service: Service,
}

/// The various log format options
Expand Down Expand Up @@ -294,6 +297,8 @@ impl Cli {
shutdown_tx.send(crate::ShutdownKind::Normal).ok();
});

self.service.spawn_services(&config, &shutdown_rx)?;

match (self.command, mode) {
(Commands::Agent(agent), Admin::Agent(ready)) => {
agent.run(locality, config, ready, shutdown_rx).await
Expand Down
Loading

0 comments on commit 9828536

Please sign in to comment.