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:
parent
6d31e1e2c9
commit
1d4e9efa15
5 changed files with 65 additions and 99 deletions
emgauwa-controller/src
|
@ -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(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue