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:
commit
65c26822ef
2 changed files with 12 additions and 1 deletions
|
|
@ -27,4 +27,9 @@ hex = "0.4.3"
|
||||||
macros = { path = "macros" }
|
macros = { path = "macros" }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tonic-build = "0.12.3"
|
tonic-build = "0.12.3"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["secure", "auth"]
|
||||||
|
secure = []
|
||||||
|
auth = []
|
||||||
|
|
@ -240,10 +240,16 @@ async fn start_secure_server() -> SecureServer{
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn start_servers(){
|
async fn start_servers(){
|
||||||
|
|
||||||
|
|
||||||
|
#[cfg(feature = "auth")]
|
||||||
let auth_server = start_auth_server().await;
|
let auth_server = start_auth_server().await;
|
||||||
|
#[cfg(feature = "secure")]
|
||||||
let secure_server = start_secure_server().await;
|
let secure_server = start_secure_server().await;
|
||||||
|
|
||||||
|
#[cfg(feature = "auth")]
|
||||||
auth_server.join_handle.await.expect("auth server crashed");
|
auth_server.join_handle.await.expect("auth server crashed");
|
||||||
|
#[cfg(feature = "secure")]
|
||||||
secure_server.join_handle.await.expect("auth server crashed");
|
secure_server.join_handle.await.expect("auth server crashed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue