federate-less-noisy (#4263)

retry_fetch_on_test
phiresky 2023-12-14 13:25:04 +01:00 committed by GitHub
parent 32afc32bc0
commit 7353be5b68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -154,7 +154,6 @@ async fn receive_print_stats(
tokio::select! {
ele = receiver.recv() => {
let Some((domain, ele)) = ele else {
tracing::info!("done. quitting");
print_stats(pool, &stats).await;
return;
};
@ -181,9 +180,9 @@ async fn print_stats(pool: &mut DbPool<'_>, stats: &HashMap<String, FederationQu
.expect("0 is valid nanos")
.to_rfc3339()
);
// todo: less noisy output (only output failing instances and summary for successful)
// todo: more stats (act/sec, avg http req duration)
let mut ok_count = 0;
let mut behind_count = 0;
for (domain, stat) in stats {
let behind = last_id.0 - stat.last_successful_id.map(|e| e.0).unwrap_or(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)
);
} else if behind > 0 {
tracing::info!("{}: Ok. {} behind", domain, behind);
tracing::debug!("{}: Ok. {} activities behind", domain, behind);
behind_count += 1;
} else {
ok_count += 1;
}
}
tracing::info!("{ok_count} others up to date");
tracing::info!("{ok_count} others up to date. {behind_count} instances behind.");
}

View File

@ -221,7 +221,7 @@ impl InstanceWorker {
SendActivityTask::prepare(object, actor.as_ref(), inbox_urls, &self.context).await?;
for task in requests {
// 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 {
self.state.fail_count += 1;
self.state.last_retry = Some(Utc::now());