mirror of
https://forgejo.ellis.link/continuwuation/continuwuity/
synced 2026-05-13 23:55:04 +00:00
fix: Pre-Commit Lint Compliance Maneuver
This commit is contained in:
+12
-7
@@ -2501,12 +2501,11 @@ fn default_servernameevent_data_cache_capacity() -> u32 {
|
||||
parallelism_scaled_u32(100_000).saturating_add(100_000)
|
||||
}
|
||||
|
||||
fn default_stateinfo_cache_capacity() -> u32 {
|
||||
parallelism_scaled_u32(500).clamp(100, 12000)
|
||||
}
|
||||
fn default_stateinfo_cache_capacity() -> u32 { parallelism_scaled_u32(500).clamp(100, 12000) }
|
||||
|
||||
fn default_roomid_spacehierarchy_cache_capacity() -> u32 {
|
||||
parallelism_scaled_u32(500).clamp(100, 12000) }
|
||||
parallelism_scaled_u32(500).clamp(100, 12000)
|
||||
}
|
||||
|
||||
fn default_dns_cache_entries() -> u32 { 327680 }
|
||||
|
||||
@@ -2719,11 +2718,17 @@ fn default_admin_room_tag() -> String { "m.server_notice".to_owned() }
|
||||
#[allow(clippy::as_conversions, clippy::cast_precision_loss)]
|
||||
pub fn parallelism_scaled_f64(val: f64) -> f64 { val * (sys::available_parallelism() as f64) }
|
||||
|
||||
pub fn parallelism_scaled_u32(val: u32) -> u32 { val.saturating_mul(sys::available_parallelism() as u32) }
|
||||
pub fn parallelism_scaled_u32(val: u32) -> u32 {
|
||||
val.saturating_mul(sys::available_parallelism() as u32)
|
||||
}
|
||||
|
||||
pub fn parallelism_scaled_i32(val: i32) -> i32 { val.saturating_mul(sys::available_parallelism() as i32) }
|
||||
pub fn parallelism_scaled_i32(val: i32) -> i32 {
|
||||
val.saturating_mul(sys::available_parallelism() as i32)
|
||||
}
|
||||
|
||||
pub fn parallelism_scaled(val: usize) -> usize { val.saturating_mul(sys::available_parallelism()) }
|
||||
pub fn parallelism_scaled(val: usize) -> usize {
|
||||
val.saturating_mul(sys::available_parallelism())
|
||||
}
|
||||
|
||||
fn default_trusted_server_batch_size() -> usize { 256 }
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
extract::State,
|
||||
response::{IntoResponse, Response},
|
||||
};
|
||||
use conduwuit::{Result, debug_warn, err, error, trace, info};
|
||||
use conduwuit::{Result, debug_warn, err, error, info, trace};
|
||||
use conduwuit_service::Services;
|
||||
use futures::FutureExt;
|
||||
use http::{Method, StatusCode, Uri};
|
||||
|
||||
@@ -117,8 +117,12 @@ fn actual_dest_1(host_port: FedDest) -> Result<FedDest> {
|
||||
async fn actual_dest_2(&self, dest: &ServerName, cache: bool, pos: usize) -> Result<FedDest> {
|
||||
debug!("2: Hostname with included port");
|
||||
let (host, port) = dest.as_str().split_at(pos);
|
||||
self.conditional_query_and_cache(host, port.trim_start_matches(':').parse::<u16>().unwrap_or(8448), cache)
|
||||
.await?;
|
||||
self.conditional_query_and_cache(
|
||||
host,
|
||||
port.trim_start_matches(':').parse::<u16>().unwrap_or(8448),
|
||||
cache,
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(FedDest::Named(
|
||||
host.to_owned(),
|
||||
@@ -163,8 +167,12 @@ async fn actual_dest_3_2(
|
||||
) -> Result<FedDest> {
|
||||
debug!("3.2: Hostname with port in .well-known file");
|
||||
let (host, port) = delegated.split_at(pos);
|
||||
self.conditional_query_and_cache(host, port.trim_start_matches(':').parse::<u16>().unwrap_or(8448), cache)
|
||||
.await?;
|
||||
self.conditional_query_and_cache(
|
||||
host,
|
||||
port.trim_start_matches(':').parse::<u16>().unwrap_or(8448),
|
||||
cache,
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(FedDest::Named(
|
||||
host.to_owned(),
|
||||
|
||||
@@ -194,8 +194,15 @@ pub(super) async fn upgrade_outlier_to_timeline_pdu<Pdu>(
|
||||
.await;
|
||||
extremities.push(incoming_pdu.event_id().to_owned());
|
||||
|
||||
if extremities.len() == 0 { info!("Retained zero extremities when upgrading outlier PDU to timeline PDU with {} previous events, event id: {}", incoming_pdu.prev_events.len(), incoming_pdu.event_id) }
|
||||
|
||||
if extremities.len() == 0 {
|
||||
info!(
|
||||
"Retained zero extremities when upgrading outlier PDU to timeline PDU with {} \
|
||||
previous events, event id: {}",
|
||||
incoming_pdu.prev_events.len(),
|
||||
incoming_pdu.event_id
|
||||
)
|
||||
}
|
||||
|
||||
debug!(
|
||||
"Retained {} extremities checked against {} prev_events",
|
||||
extremities.len(),
|
||||
|
||||
Reference in New Issue
Block a user