mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-20 00:15:17 +00:00
Fix propagation issue
This commit is contained in:
@ -99,18 +99,20 @@ impl actix::Actor for RtcRelayActor {
|
||||
}).unwrap())
|
||||
}
|
||||
|
||||
fn stopped(&mut self, ctx: &mut Self::Context) {
|
||||
fn stopping(&mut self, _: &mut Self::Context) -> Running {
|
||||
println!("Closed connection to RTC relay.");
|
||||
let future = async move {
|
||||
// Propagate information
|
||||
if let Err(e) = events_helper::propagate_event(Event::ClosedRTCRelayWebSocket).await {
|
||||
eprintln!("Failed to propagate rtc closed event! {:#?}", e);
|
||||
} else {
|
||||
eprintln!("Successfully propagated RTC relay stopped event!");
|
||||
}
|
||||
|
||||
eprintln!("Successfully propagated RTC relay stopped envent!");
|
||||
};
|
||||
|
||||
future.into_actor(self).wait(ctx);
|
||||
futures::executor::block_on(future);
|
||||
|
||||
Running::Stop
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -320,13 +320,12 @@ impl Actor for WsSession {
|
||||
let future = async move {
|
||||
if let Err(e) = events_helper::propagate_event(Event::UserWsClosed(conn)).await {
|
||||
eprintln!("Failed to propagate web socket closed event ! {:#?}", e);
|
||||
} else {
|
||||
eprintln!("Successfully propagated user ws stopping event!");
|
||||
}
|
||||
|
||||
// TODO : remove
|
||||
eprintln!("Successfully propagated user ws stopping event!");
|
||||
};
|
||||
|
||||
future.into_actor(self).wait(ctx);
|
||||
futures::executor::block_on(future);
|
||||
}
|
||||
|
||||
remove_connection(ctx.address());
|
||||
|
Reference in New Issue
Block a user