feat(startup): make both servers be able to run seperately with specification by features
This commit is contained in:
parent
f6da681ec7
commit
56d8a6ca48
2 changed files with 12 additions and 1 deletions
|
|
@ -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 = []
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue