Allow re-joining room after server restarts

This commit is contained in:
Antonio Scandurra 2022-12-12 16:03:21 +01:00
parent 82397f34d1
commit beea9b68ff
5 changed files with 141 additions and 37 deletions

View file

@ -52,12 +52,12 @@ async fn main() -> Result<()> {
init_tracing(&config);
let state = AppState::new(config).await?;
state.db.clear_stale_data().await?;
let listener = TcpListener::bind(&format!("0.0.0.0:{}", state.config.http_port))
.expect("failed to bind TCP listener");
let rpc_server = collab::rpc::Server::new(state.clone());
rpc_server.start().await?;
let app = collab::api::routes(rpc_server.clone(), state.clone())
.merge(collab::rpc::routes(rpc_server.clone()))