Commit e98970f3 by qlintonger xeno

再次更新+2

parent 3fde40ca
...@@ -159,12 +159,16 @@ pub async fn handle_events(mut receiver: mpsc::UnboundedReceiver<Event>) { ...@@ -159,12 +159,16 @@ pub async fn handle_events(mut receiver: mpsc::UnboundedReceiver<Event>) {
println!("将用户信息插入到 Redis 中时出错: {}", e); println!("将用户信息插入到 Redis 中时出错: {}", e);
} }
}); });
tokio::spawn(async move {
notify_all_clients_to_update_online_users().await; notify_all_clients_to_update_online_users().await;
});
} }
Event::CloseConnection(from_id) => { Event::CloseConnection(from_id) => {
println!("有关闭的连接 用户id {:?} 更新在线用户列表事件触发", from_id); println!("有关闭的连接 用户id {:?} 更新在线用户列表事件触发", from_id);
close_existing_connection(&from_id, false).await; close_existing_connection(&from_id, false).await;
tokio::spawn(async move {
notify_all_clients_to_update_online_users().await; notify_all_clients_to_update_online_users().await;
});
} }
Event::SendClientMessage(from_id, msg, close) => { Event::SendClientMessage(from_id, msg, close) => {
println!("事件中心代发消息 ===>> 发送消息 {:?} 到客户端 {:?}", msg, from_id); println!("事件中心代发消息 ===>> 发送消息 {:?} 到客户端 {:?}", msg, from_id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment