Use a synchronous mutex for ConnectionPool

This commit is contained in:
Antonio Scandurra 2022-12-13 13:50:51 +01:00
parent a594ba8f8a
commit d4c8fa3090
3 changed files with 20 additions and 20 deletions

View file

@ -23,6 +23,11 @@ pub struct Connection {
}
impl ConnectionPool {
pub fn reset(&mut self) {
self.connections.clear();
self.connected_users.clear();
}
#[instrument(skip(self))]
pub fn add_connection(&mut self, connection_id: ConnectionId, user_id: UserId, admin: bool) {
self.connections