Skip to content

Commit

Permalink
merged with main
Browse files Browse the repository at this point in the history
  • Loading branch information
aramikm committed May 2, 2024
2 parents 126d8cb + 0afd737 commit e7ef83d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/src/graph/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,15 @@ impl Graph {
})
.collect();

let ids_to_add: Vec<DsnpUserId> = updates
let mut ids_to_add: Vec<DsnpUserId> = updates
.iter()
.filter_map(|event| match event {
UpdateEvent::Add { dsnp_user_id, .. } => Some(*dsnp_user_id),
_ => None,
})
.collect();
// helps with the compression
ids_to_add.sort();

// First calculate pages that have had connections removed. Later, we will
// prefer to use these pages first to add new connections, so as to minimize
Expand Down Expand Up @@ -665,6 +667,10 @@ impl Graph {
.iter()
.filter(|c| !ids_to_add.contains(&c.user_id))
{
// This timestamp condition is eliminating PRID checks for 2 categories of connections
// 1. Connections that are just added but not included in `ids_to_add` list
// 2. Connections that are added less than `max_allowed_stale_days` since we need some time for the other
// side of the connection to act on it
if duration_days_since(c.since) > max_allowed_stale_days &&
!self
.user_key_manager
Expand Down

0 comments on commit e7ef83d

Please sign in to comment.