mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 07:36:01 +00:00
federate-less-noisy (#4263)
This commit is contained in:
parent
32afc32bc0
commit
7353be5b68
|
@ -154,7 +154,6 @@ async fn receive_print_stats(
|
||||||
tokio::select! {
|
tokio::select! {
|
||||||
ele = receiver.recv() => {
|
ele = receiver.recv() => {
|
||||||
let Some((domain, ele)) = ele else {
|
let Some((domain, ele)) = ele else {
|
||||||
tracing::info!("done. quitting");
|
|
||||||
print_stats(pool, &stats).await;
|
print_stats(pool, &stats).await;
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
@ -181,9 +180,9 @@ async fn print_stats(pool: &mut DbPool<'_>, stats: &HashMap<String, FederationQu
|
||||||
.expect("0 is valid nanos")
|
.expect("0 is valid nanos")
|
||||||
.to_rfc3339()
|
.to_rfc3339()
|
||||||
);
|
);
|
||||||
// todo: less noisy output (only output failing instances and summary for successful)
|
|
||||||
// todo: more stats (act/sec, avg http req duration)
|
// todo: more stats (act/sec, avg http req duration)
|
||||||
let mut ok_count = 0;
|
let mut ok_count = 0;
|
||||||
|
let mut behind_count = 0;
|
||||||
for (domain, stat) in stats {
|
for (domain, stat) in stats {
|
||||||
let behind = last_id.0 - stat.last_successful_id.map(|e| e.0).unwrap_or(0);
|
let behind = last_id.0 - stat.last_successful_id.map(|e| e.0).unwrap_or(0);
|
||||||
if stat.fail_count > 0 {
|
if stat.fail_count > 0 {
|
||||||
|
@ -195,10 +194,11 @@ async fn print_stats(pool: &mut DbPool<'_>, stats: &HashMap<String, FederationQu
|
||||||
federate_retry_sleep_duration(stat.fail_count)
|
federate_retry_sleep_duration(stat.fail_count)
|
||||||
);
|
);
|
||||||
} else if behind > 0 {
|
} else if behind > 0 {
|
||||||
tracing::info!("{}: Ok. {} behind", domain, behind);
|
tracing::debug!("{}: Ok. {} activities behind", domain, behind);
|
||||||
|
behind_count += 1;
|
||||||
} else {
|
} else {
|
||||||
ok_count += 1;
|
ok_count += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tracing::info!("{ok_count} others up to date");
|
tracing::info!("{ok_count} others up to date. {behind_count} instances behind.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,7 +221,7 @@ impl InstanceWorker {
|
||||||
SendActivityTask::prepare(object, actor.as_ref(), inbox_urls, &self.context).await?;
|
SendActivityTask::prepare(object, actor.as_ref(), inbox_urls, &self.context).await?;
|
||||||
for task in requests {
|
for task in requests {
|
||||||
// usually only one due to shared inbox
|
// usually only one due to shared inbox
|
||||||
tracing::info!("sending out {}", task);
|
tracing::debug!("sending out {}", task);
|
||||||
while let Err(e) = task.sign_and_send(&self.context).await {
|
while let Err(e) = task.sign_and_send(&self.context).await {
|
||||||
self.state.fail_count += 1;
|
self.state.fail_count += 1;
|
||||||
self.state.last_retry = Some(Utc::now());
|
self.state.last_retry = Some(Utc::now());
|
||||||
|
|
Loading…
Reference in a new issue