Skip to content

Commit

Permalink
Disable retry queue option
Browse files Browse the repository at this point in the history
  • Loading branch information
cetra3 committed Jul 3, 2023
1 parent 050216e commit 91bda74
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 15 deletions.
56 changes: 42 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ lemmy_routes = { version = "=0.18.1-rc.4", path = "./crates/routes" }
lemmy_db_views = { version = "=0.18.1-rc.4", path = "./crates/db_views" }
lemmy_db_views_actor = { version = "=0.18.1-rc.4", path = "./crates/db_views_actor" }
lemmy_db_views_moderator = { version = "=0.18.1-rc.4", path = "./crates/db_views_moderator" }
activitypub_federation = { version = "0.4.4", default-features = false, features = ["actix-web"] }
activitypub_federation = { git = "https://github.com/cetra3/activitypub-federation-rust.git", branch = "disable_retry_queue" }
diesel = "2.1.0"
diesel_migrations = "2.1.0"
diesel-async = "0.3.1"
Expand Down
2 changes: 2 additions & 0 deletions config/defaults.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,6 @@
worker_count: 0
# The number of activitypub federation retry workers that can be in-flight concurrently
retry_count: 0
# Whether the retry queue is disabled or not. If true, nothing is retried
disable_retry: true
}
3 changes: 3 additions & 0 deletions crates/utils/src/settings/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ pub struct Settings {
/// The number of activitypub federation retry workers that can be in-flight concurrently
#[default(0)]
pub retry_count: usize,
/// Whether the retry queue is disabled or not. If true, nothing is retried
#[default(true)]
pub disable_retry: bool,
}

#[derive(Debug, Deserialize, Serialize, Clone, SmartDefault, Document)]
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ pub async fn start_lemmy_server() -> Result<(), LemmyError> {
.http_fetch_limit(FEDERATION_HTTP_FETCH_LIMIT)
.worker_count(settings.worker_count)
.retry_count(settings.retry_count)
.disable_retry(settings.disable_retry)
.debug(cfg!(debug_assertions))
.http_signature_compat(true)
.url_verifier(Box::new(VerifyUrlData(context.pool().clone())))
Expand Down

0 comments on commit 91bda74

Please sign in to comment.