Censor stops getting new credentials faster

This commit is contained in:
Vecna 2024-07-03 13:52:00 -04:00
parent 21288a935d
commit 78c3443a92
1 changed files with 7 additions and 4 deletions

View File

@ -292,17 +292,20 @@ pub async fn main() {
// CENSOR TASKS
// On the day the censor activates, learn only the next 3 bridges (for efficiency)
// On the day the censor activates, get as many credentials as
// possible for the current bridge. For efficiency, don't get
// credentials for bridges that will never be distributed to
// non-censor users.
if date == censor.start_date {
let num_bridges_before = censor.known_bridges.len();
// Censor gets as many invites as possible for 3 bridges
// Censor gets as many invites as possible for 1 bridge
while let Ok(new_user) = User::new(&sconfig, true, &mut bridges, &mut censor).await {
// Add new censor user
users.push(new_user);
// If we now know 3 more bridges, break
if censor.known_bridges.len() >= num_bridges_before + 3 {
// If we now know 2 more bridges, break
if censor.known_bridges.len() > num_bridges_before + 1 {
break;
}
}