1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-09-25 22:29:45 +00:00

Close concurrent call accesses

This commit is contained in:
2021-02-10 18:26:19 +01:00
parent 5194a389af
commit 024d83619d
2 changed files with 22 additions and 3 deletions

View File

@@ -573,7 +573,9 @@ pub fn disconnect_user_from_all_sockets(user_id: &UserID) -> Res {
/// Do something with all active connections
pub fn foreach_connection<F>(mut f: F) -> Res
where F: FnMut(&UserWsConnection) -> Res {
for conn in get_ws_connections_list().lock().unwrap().iter() {
let list = get_ws_connections_list().lock().unwrap().clone();
for conn in list.iter() {
f(conn)?;
}