fix: spawn songbird processing the event to try to address deadlock issue
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -478,7 +478,15 @@ async fn handle_events(command_router: Arc<CommandRouter>, state: State, mut sha
|
||||
|
||||
#[tracing::instrument(skip(command_router, state))]
|
||||
async fn handle_event(command_router: Arc<CommandRouter>, state: State, event: Event) {
|
||||
state.songbird.process(&event).await;
|
||||
tokio::spawn({
|
||||
let event = event.clone();
|
||||
let songbird = state.songbird.clone();
|
||||
async move {
|
||||
songbird.process(&event).await;
|
||||
}
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
match event {
|
||||
Event::VoiceStateUpdate(voice_state_update) => {
|
||||
|
||||
Reference in New Issue
Block a user