Skip to content

Commit

Permalink
drop changes from back of the queue
Browse files Browse the repository at this point in the history
  • Loading branch information
somtochiama committed Nov 1, 2024
1 parent 0396633 commit 8f2ddcf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion crates/corro-agent/src/agent/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ pub async fn handle_changes(

// drop old items when the queue is full.
if queue.len() > max_queue_len {
let change = queue.pop_front();
let change = queue.pop_back();
if let Some(change) = change {
for v in change.0.versions() {
let _ = seen.remove(&(change.0.actor_id, v));
Expand Down
2 changes: 0 additions & 2 deletions crates/corro-agent/src/api/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1212,8 +1212,6 @@ pub async fn parallel_sync(
})
.collect();

// NOTE: IMPORTANT! shuffle the vec so we don't keep looping over the same later on

needs
.into_iter()
.map(|need| (actor_id, need))
Expand Down

0 comments on commit 8f2ddcf

Please sign in to comment.