mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
investigate if participant mutex causes server hang
This commit is contained in:
parent
6d2c4b9c1a
commit
1beea5967f
@ -80,7 +80,13 @@ pub fn handle_exit_ingame(server: &mut Server, entity: EcsEntity) {
|
||||
pub fn handle_client_disconnect(server: &mut Server, entity: EcsEntity) -> Event {
|
||||
if let Some(client) = server.state().read_storage::<Client>().get(entity) {
|
||||
trace!("Closing participant of client");
|
||||
let participant = client.participant.lock().unwrap().take().unwrap();
|
||||
let participant = match client.participant.try_lock() {
|
||||
Ok(mut p) => p.take().unwrap(),
|
||||
Err(e) => {
|
||||
error!(?e, "coudln't lock participant for removal");
|
||||
panic!("coudlnt lock participant, not good!");
|
||||
},
|
||||
};
|
||||
if let Err(e) = block_on(participant.disconnect()) {
|
||||
debug!(
|
||||
?e,
|
||||
|
Loading…
Reference in New Issue
Block a user