feat: don't block bot startup waiting to initialize vcs
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -285,14 +285,14 @@ async fn main() -> Result<(), MainError> {
|
||||
let discord_opt_in_command_name = discord_opt_in_command.name.into();
|
||||
let discord_opt_out_command_name = discord_opt_out_command.name.into();
|
||||
|
||||
let vcs = initialize_vcs(&discord_client).await;
|
||||
|
||||
let command_router = CommandRouter::from_iter(commands);
|
||||
let command_router = Arc::new(command_router);
|
||||
|
||||
let discord_client = Arc::new(discord_client);
|
||||
let songbird = Arc::new(songbird);
|
||||
let vcs_sender = VCsSender::new(vcs);
|
||||
let vcs_sender = VCsSender::new(Default::default());
|
||||
|
||||
let initializing_vcs = initialize_vcs(&vcs_sender, &discord_client);
|
||||
|
||||
let bot_data = bot_data.into_inner();
|
||||
let recording_data = recording_data.into_inner();
|
||||
@@ -327,7 +327,7 @@ async fn main() -> Result<(), MainError> {
|
||||
cancellation_token: cancellation_token.clone(),
|
||||
discord_application_id,
|
||||
discord_bot_owner_user_id,
|
||||
discord_client,
|
||||
discord_client: discord_client.clone(),
|
||||
discord_info_command_id,
|
||||
discord_info_command_name,
|
||||
discord_opt_in_command_id,
|
||||
@@ -340,7 +340,7 @@ async fn main() -> Result<(), MainError> {
|
||||
render_manager,
|
||||
songbird,
|
||||
user_manager,
|
||||
vcs_sender,
|
||||
vcs_sender: vcs_sender.clone(),
|
||||
};
|
||||
|
||||
let heat_seeking = tokio::spawn(heat_seek(state.clone()));
|
||||
@@ -394,6 +394,7 @@ async fn main() -> Result<(), MainError> {
|
||||
});
|
||||
|
||||
let finished_naturally = async move {
|
||||
initializing_vcs.await;
|
||||
heat_seeking.await.unwrap();
|
||||
run_shards.await;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user