diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bd27c6..7b568a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Put activities generated by CLI commands in a queue instead of immediately sending them. - Changed path of user's Atom feed to `/feeds/users/{username}`. +- Increase number of delivery attempts and increase intervals between them. ### Deprecated diff --git a/src/activitypub/queues.rs b/src/activitypub/queues.rs index 46574a7..b52637d 100644 --- a/src/activitypub/queues.rs +++ b/src/activitypub/queues.rs @@ -135,12 +135,12 @@ impl OutgoingActivityJobData { } const OUTGOING_QUEUE_BATCH_SIZE: u32 = 1; -const OUTGOING_QUEUE_RETRIES_MAX: u32 = 2; +const OUTGOING_QUEUE_RETRIES_MAX: u32 = 3; -// 30 secs, 5 mins, 50 mins, 8 hours +// 5 mins, 50 mins, 8 hours pub fn outgoing_queue_backoff(failure_count: u32) -> u32 { debug_assert!(failure_count > 0); - 3 * 10_u32.pow(failure_count) + 30 * 10_u32.pow(failure_count) } pub async fn process_queued_outgoing_activities( @@ -211,7 +211,7 @@ mod tests { #[test] fn test_outgoing_queue_backoff() { - assert_eq!(outgoing_queue_backoff(1), 30); - assert_eq!(outgoing_queue_backoff(2), 300); + assert_eq!(outgoing_queue_backoff(1), 300); + assert_eq!(outgoing_queue_backoff(2), 3000); } }