Merge remote-tracking branch 'origin/main' into moderate_deleted_removed_communities_bug

This commit is contained in:
Dessalines 2024-07-22 18:22:27 -04:00
commit ea2b1ca008
3 changed files with 4 additions and 3 deletions

1
Cargo.lock generated
View file

@ -3075,6 +3075,7 @@ dependencies = [
"reqwest 0.11.27", "reqwest 0.11.27",
"reqwest-middleware 0.2.5", "reqwest-middleware 0.2.5",
"reqwest-tracing 0.4.8", "reqwest-tracing 0.4.8",
"rustls 0.23.10",
"serde_json", "serde_json",
"serial_test", "serial_test",
"tokio", "tokio",

View file

@ -76,7 +76,7 @@ pub(crate) struct InstanceWorker {
// that are not the lowest number and thus can't be written to the database yet // that are not the lowest number and thus can't be written to the database yet
successfuls: BinaryHeap<SendSuccessInfo>, successfuls: BinaryHeap<SendSuccessInfo>,
// number of activities that currently have a task spawned to send it // number of activities that currently have a task spawned to send it
in_flight: i32, in_flight: i8,
} }
impl InstanceWorker { impl InstanceWorker {
@ -127,7 +127,7 @@ impl InstanceWorker {
// too many in flight // too many in flight
let need_wait_for_event = (self.in_flight != 0 && self.state.fail_count > 0) let need_wait_for_event = (self.in_flight != 0 && self.state.fail_count > 0)
|| self.successfuls.len() >= MAX_SUCCESSFULS || self.successfuls.len() >= MAX_SUCCESSFULS
|| i64::from(self.in_flight) >= self.federation_worker_config.concurrent_sends_per_instance; || self.in_flight >= self.federation_worker_config.concurrent_sends_per_instance;
if need_wait_for_event || self.receive_send_result.len() > MIN_ACTIVITY_SEND_RESULTS_TO_HANDLE if need_wait_for_event || self.receive_send_result.len() > MIN_ACTIVITY_SEND_RESULTS_TO_HANDLE
{ {
// if len() > 0 then this does not block and allows us to write to db more often // if len() > 0 then this does not block and allows us to write to db more often

View file

@ -242,5 +242,5 @@ pub struct FederationWorkerConfig {
/// Set this to a higher value than 1 (e.g. 6) only if you have a huge instance (>10 activities /// Set this to a higher value than 1 (e.g. 6) only if you have a huge instance (>10 activities
/// per second) and if a receiving instance is not keeping up. /// per second) and if a receiving instance is not keeping up.
#[default(1)] #[default(1)]
pub concurrent_sends_per_instance: i64, pub concurrent_sends_per_instance: i8,
} }