Try to fix the threading

Add explicit tokio::spawn in controller
Add an arbiter for the app_state in core
This commit is contained in:
Tobias Reisinger 2024-03-28 01:23:49 +01:00
parent 6d31e1e2c9
commit 1d4e9efa15
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
5 changed files with 65 additions and 99 deletions
emgauwa-controller/src

View file

@ -112,10 +112,10 @@ async fn main() -> Result<(), std::io::Error> {
);
tokio::select! {
_ = run_relays_loop(app_state.clone()) => {},
_ = run_ws_loop(pool.clone(), app_state.clone(), url) => {},
}
let _ = tokio::join!(
tokio::spawn(run_relays_loop(app_state.clone())),
tokio::spawn(run_ws_loop(pool.clone(), app_state.clone(), url)),
);
Ok(())
}