Skip to content

Commit

Permalink
fix: fixing activity queue order
Browse files Browse the repository at this point in the history
  • Loading branch information
112batuhan committed Dec 8, 2024
1 parent a528970 commit e08e239
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/handlers/activity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ impl ActivityTracker {

pub fn add_new_activity_to_queue(&self, new_activity: Activity) -> Result<(), AppError> {
let mut locked_queue = self.lock_activity_queue()?;
locked_queue.push_front(new_activity);
locked_queue.push_back(new_activity);
if locked_queue.len() > self.queue_size.into() {
locked_queue.pop_back();
locked_queue.pop_front();
}
Ok(())
}
Expand Down

0 comments on commit e08e239

Please sign in to comment.