Move setting http_fetch_retry_limit into federation block (#2314)

This commit is contained in:
Nutomic 2022-06-14 05:20:30 +00:00 committed by GitHub
parent c78de25652
commit cd4d235171
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -62,6 +62,8 @@
# use allowlist only for remote communities, and posts/comments in local communities
# (meaning remote communities will show content from arbitrary instances).
strict_allowlist: true
# Maximum number of HTTP requests allowed to handle a single incoming activity (or a single object fetch through the search).
http_fetch_retry_limit: 25
# Number of workers for sending outgoing activities. Search logs for Activity queue stats to
# see information. If running number is consistently close to the worker_count, you should
# increase it.
@ -119,6 +121,4 @@
slur_filter: "(\bThis\b)|(\bis\b)|(\bsample\b)"
# Maximum length of local community and user names
actor_name_max_length: 20
# Maximum number of HTTP requests allowed to handle a single incoming activity (or a single object fetch through the search).
http_fetch_retry_limit: 25
}

View File

@ -47,7 +47,7 @@ where
debug!("Fetching webfinger url: {}", &fetch_url);
*request_counter += 1;
if *request_counter > context.settings().http_fetch_retry_limit {
if *request_counter > context.settings().federation.http_fetch_retry_limit {
return Err(LemmyError::from_message("Request retry limit reached"));
}

View File

@ -31,7 +31,7 @@ fn local_instance(context: &LemmyContext) -> &'static LocalInstance {
static LOCAL_INSTANCE: OnceCell<LocalInstance> = OnceCell::new();
LOCAL_INSTANCE.get_or_init(|| {
let settings = InstanceSettingsBuilder::default()
.http_fetch_retry_limit(context.settings().http_fetch_retry_limit)
.http_fetch_retry_limit(context.settings().federation.http_fetch_retry_limit)
.worker_count(context.settings().federation.worker_count)
.debug(context.settings().federation.debug)
.verify_url_function(|url| check_apub_id_valid(url, &Settings::get()))

View File

@ -46,9 +46,6 @@ pub struct Settings {
/// Maximum length of local community and user names
#[default(20)]
pub actor_name_max_length: usize,
/// Maximum number of HTTP requests allowed to handle a single incoming activity (or a single object fetch through the search).
#[default(25)]
pub http_fetch_retry_limit: i32,
/// Set the URL for opentelemetry exports. If you do not have an opentelemetry collector, do not set this option
#[default(None)]
@ -142,6 +139,9 @@ pub struct FederationConfig {
/// (meaning remote communities will show content from arbitrary instances).
#[default(true)]
pub strict_allowlist: bool,
/// Maximum number of HTTP requests allowed to handle a single incoming activity (or a single object fetch through the search).
#[default(25)]
pub http_fetch_retry_limit: i32,
/// Number of workers for sending outgoing activities. Search logs for "Activity queue stats" to
/// see information. If "running" number is consistently close to the worker_count, you should
/// increase it.