From 21288a935d38a5f26d9140a2febea884985ac1b7 Mon Sep 17 00:00:00 2001 From: Vecna Date: Sat, 29 Jun 2024 14:48:44 -0400 Subject: [PATCH] Remove newly added users from backlog --- src/main.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main.rs b/src/main.rs index c81b1ee..c59f074 100644 --- a/src/main.rs +++ b/src/main.rs @@ -251,6 +251,9 @@ pub async fn main() { // Add new users users.append(&mut new_users); + // Track new user count + let mut num_new_users = 0; + // For each user requesting an invite, see if one is available. // If not, they can try to join via open-entry invitation if the // censor is not active. @@ -274,10 +277,19 @@ pub async fn main() { if !user_created && !censor.is_active() { if let Ok(user) = User::new(&sconfig, false, &mut bridges, &mut censor).await { users.push(user); + user_created = true; } } + + if user_created { + // We successfully added a user, increment count + num_new_users += 1; + } } + // Remove new users from backlog + num_users_requesting_invites -= num_new_users; + // CENSOR TASKS // On the day the censor activates, learn only the next 3 bridges (for efficiency)