Pārlūkot izejas kodu

Remove newly added users from backlog

Vecna 7 mēneši atpakaļ
vecāks
revīzija
21288a935d
1 mainītis faili ar 12 papildinājumiem un 0 dzēšanām
  1. 12 0
      src/main.rs

+ 12 - 0
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)