mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-21 14:17:08 +00:00
Change type of concurrent sends in config (#4914)
This commit is contained in:
parent
3d80ac2ebb
commit
572a42d880
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -3075,6 +3075,7 @@ dependencies = [
|
|||
"reqwest 0.11.27",
|
||||
"reqwest-middleware 0.2.5",
|
||||
"reqwest-tracing 0.4.8",
|
||||
"rustls 0.23.10",
|
||||
"serde_json",
|
||||
"serial_test",
|
||||
"tokio",
|
||||
|
|
|
@ -76,7 +76,7 @@ pub(crate) struct InstanceWorker {
|
|||
// that are not the lowest number and thus can't be written to the database yet
|
||||
successfuls: BinaryHeap<SendSuccessInfo>,
|
||||
// number of activities that currently have a task spawned to send it
|
||||
in_flight: i32,
|
||||
in_flight: i8,
|
||||
}
|
||||
|
||||
impl InstanceWorker {
|
||||
|
@ -127,7 +127,7 @@ impl InstanceWorker {
|
|||
// too many in flight
|
||||
let need_wait_for_event = (self.in_flight != 0 && self.state.fail_count > 0)
|
||||
|| 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 len() > 0 then this does not block and allows us to write to db more often
|
||||
|
|
|
@ -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
|
||||
/// per second) and if a receiving instance is not keeping up.
|
||||
#[default(1)]
|
||||
pub concurrent_sends_per_instance: i64,
|
||||
pub concurrent_sends_per_instance: i8,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue