diff --git a/CHANGELOG.md b/CHANGELOG.md index 63402e51..1fa5d4ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ ### Changed - Bump Rust to nightly 2022-01-26 (#1015) +- Remove "Latest articles" timeline (#1069) +- Change order of timeline tabs (#1069, #1070) - Migrate ActivityPub-related crates from activitypub 0.1 to activitystreams 0.7 ### Fixed diff --git a/plume-common/src/activity_pub/mod.rs b/plume-common/src/activity_pub/mod.rs index cebaa924..fc5c7bd7 100644 --- a/plume-common/src/activity_pub/mod.rs +++ b/plume-common/src/activity_pub/mod.rs @@ -18,7 +18,10 @@ use rocket::{ response::{Responder, Response}, Outcome, }; -use tokio::runtime; +use tokio::{ + runtime, + time::{sleep, Duration}, +}; use tracing::{debug, warn}; use self::sign::Signable; @@ -167,6 +170,9 @@ where let rx = rx.clone(); let handle = rt.spawn(async move { while let Ok(request_builder) = rx.recv_async().await { + // After broadcasting, target instance sends request to this instance. + // Sleep here in order to reduce requests at once + sleep(Duration::from_millis(500)).await; let _ = request_builder .send() .await diff --git a/plume-models/src/timeline/mod.rs b/plume-models/src/timeline/mod.rs index 8f80310c..e1f4c2e2 100644 --- a/plume-models/src/timeline/mod.rs +++ b/plume-models/src/timeline/mod.rs @@ -91,7 +91,7 @@ impl Timeline { if t1.user_id.is_some() && t2.user_id.is_none() { Ordering::Less } else { - Ordering::Equal + t1.id.cmp(&t2.id) } }); timelines