Merge pull request #6 from Perditum/feat/conditional-server-compilation

feat(startup): make both servers be able to run separately with specification by features
This commit is contained in:
SPFN Administrator 2025-02-08 14:03:02 +01:00 committed by GitHub Enterprise
commit 65c26822ef
2 changed files with 12 additions and 1 deletions

View file

@ -27,4 +27,9 @@ hex = "0.4.3"
macros = { path = "macros" }
[build-dependencies]
tonic-build = "0.12.3"
tonic-build = "0.12.3"
[features]
default = ["secure", "auth"]
secure = []
auth = []

View file

@ -240,10 +240,16 @@ async fn start_secure_server() -> SecureServer{
}
async fn start_servers(){
#[cfg(feature = "auth")]
let auth_server = start_auth_server().await;
#[cfg(feature = "secure")]
let secure_server = start_secure_server().await;
#[cfg(feature = "auth")]
auth_server.join_handle.await.expect("auth server crashed");
#[cfg(feature = "secure")]
secure_server.join_handle.await.expect("auth server crashed");
}