From 1a0c866b5169cfc8130e53df69dc6e1dbc190361 Mon Sep 17 00:00:00 2001 From: phiresky Date: Wed, 20 Sep 2023 13:37:18 +0000 Subject: [PATCH] logging temporary --- crates/apub/src/activities/mod.rs | 7 ++++--- crates/federate/src/worker.rs | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/apub/src/activities/mod.rs b/crates/apub/src/activities/mod.rs index fcb90b13a..b7cbbd500 100644 --- a/crates/apub/src/activities/mod.rs +++ b/crates/apub/src/activities/mod.rs @@ -217,12 +217,12 @@ where ActorT: Actor + GetActorType, Activity: ActivityHandler, { - info!("Sending activity {}", activity.id().to_string()); + info!("Saving outgoing activity to queue {}", activity.id()); let activity = WithContext::new(activity, CONTEXT.deref().clone()); let form = SentActivityForm { ap_id: activity.id().clone().into(), - data: serde_json::to_value(activity.clone())?, + data: serde_json::to_value(activity)?, sensitive, send_inboxes: send_targets .inboxes @@ -234,7 +234,8 @@ where actor_type: actor.actor_type(), actor_apub_id: actor.id().into(), }; - SentActivity::create(&mut data.pool(), form).await?; + let created = SentActivity::create(&mut data.pool(), form).await?; + info!("Queued for send: {:?}", created); Ok(()) } diff --git a/crates/federate/src/worker.rs b/crates/federate/src/worker.rs index 249fc100e..14c86a7d3 100644 --- a/crates/federate/src/worker.rs +++ b/crates/federate/src/worker.rs @@ -161,10 +161,12 @@ impl InstanceWorker { { id += 1; processed_activities += 1; + tracing::info!("looking at activity {id}, proc={processed_activities}, latest={latest_id}"); let Some(ele) = get_activity_cached(pool, id) .await .context("failed reading activity from db")? else { + tracing::info!("activity {id} empty, marking latest"); self.state.last_successful_id = id; continue; };