Compare commits
2 Commits
68fffacc59
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
32c12186c1
|
|||
|
2f933d5302
|
@@ -46,8 +46,15 @@ mod server_only {
|
|||||||
let mut disconnected_client_ids = HashSet::new();
|
let mut disconnected_client_ids = HashSet::new();
|
||||||
let subscribed_clients = SUBSCRIBED_CLIENTS.read().await;
|
let subscribed_clients = SUBSCRIBED_CLIENTS.read().await;
|
||||||
for (id, client) in subscribed_clients.iter() {
|
for (id, client) in subscribed_clients.iter() {
|
||||||
if let Err(_) = client.websocket.lock().await.send(UpdateEvent).await {
|
if client
|
||||||
disconnected_client_ids.insert(id.clone());
|
.websocket
|
||||||
|
.lock()
|
||||||
|
.await
|
||||||
|
.send(UpdateEvent)
|
||||||
|
.await
|
||||||
|
.is_err()
|
||||||
|
{
|
||||||
|
disconnected_client_ids.insert(*id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drop(subscribed_clients);
|
drop(subscribed_clients);
|
||||||
|
|||||||
Reference in New Issue
Block a user