forked from lavina/lavina
Fix Storage closing during app shutdown.
Storage was still co-owned by the RoomRegistry, which did not allow us to shut it down gracefully. Dropping RoomRegistry explicitly helps.
This commit is contained in:
parent
1b5ac1491a
commit
f401aa786e
|
@ -58,7 +58,7 @@ async fn main() -> Result<()> {
|
||||||
let telemetry_terminator =
|
let telemetry_terminator =
|
||||||
util::telemetry::launch(telemetry_config, metrics.clone(), rooms.clone()).await?;
|
util::telemetry::launch(telemetry_config, metrics.clone(), rooms.clone()).await?;
|
||||||
let irc = projections::irc::launch(irc_config, players.clone(), rooms.clone(), metrics.clone(), storage.clone()).await?;
|
let irc = projections::irc::launch(irc_config, players.clone(), rooms.clone(), metrics.clone(), storage.clone()).await?;
|
||||||
let xmpp = projections::xmpp::launch(xmpp_config, players, rooms.clone(), metrics.clone()).await?;
|
let xmpp = projections::xmpp::launch(xmpp_config, players.clone(), rooms.clone(), metrics.clone()).await?;
|
||||||
tracing::info!("Started");
|
tracing::info!("Started");
|
||||||
|
|
||||||
sleep.await;
|
sleep.await;
|
||||||
|
@ -66,8 +66,10 @@ async fn main() -> Result<()> {
|
||||||
tracing::info!("Begin shutdown");
|
tracing::info!("Begin shutdown");
|
||||||
xmpp.terminate().await?;
|
xmpp.terminate().await?;
|
||||||
irc.terminate().await?;
|
irc.terminate().await?;
|
||||||
storage.close().await?;
|
|
||||||
telemetry_terminator.terminate().await?;
|
telemetry_terminator.terminate().await?;
|
||||||
|
drop(players);
|
||||||
|
drop(rooms);
|
||||||
|
storage.close().await?;
|
||||||
tracing::info!("Shutdown complete");
|
tracing::info!("Shutdown complete");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue