count connected friends users correctly
All checks were successful
Build and Test / friends (push) Successful in 3m3s
Build and Test / splatoon (push) Successful in 3m27s

This commit is contained in:
Maple 2026-04-26 13:53:52 +02:00
commit 2a2dbd5ff1

View file

@ -200,7 +200,7 @@ impl Friends for FriendsUser {
println!("acquiring user and current friends locks");
let users = self.fm.users.read().await;
if users.len() >= 100 {
if users.iter().filter(|u| u.upgrade().is_some()).count() >= 100 {
return Err(ErrorCode::RendezVous_ConnectionFailure);
}
println!("started summing users");
@ -331,7 +331,7 @@ impl Secure for FriendsUser {
) -> Result<(QResult, u32, StationUrl), ErrorCode> {
let cid = self.fm.next_cid();
let users = self.fm.users.read().await;
if users.len() >= 100 {
if users.iter().filter(|u| u.upgrade().is_some()).count() >= 100 {
return Err(ErrorCode::RendezVous_ConnectionFailure);
}
Ok((