Increase number of delivery attempts and increase intervals between them

This commit is contained in:
silverpill 2023-02-26 14:52:27 +00:00
parent c201f3ea2b
commit 62069dc011
2 changed files with 6 additions and 5 deletions

View file

@ -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

View file

@ -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);
}
}