diff --git a/upub/worker/src/delivery.rs b/upub/worker/src/delivery.rs index 897461b..ce23ed9 100644 --- a/upub/worker/src/delivery.rs +++ b/upub/worker/src/delivery.rs @@ -1,4 +1,3 @@ -use sea_orm::EntityTrait; use reqwest::Method; use apb::{LD, ActivityMut}; @@ -59,16 +58,11 @@ pub async fn process(ctx: Context, job: &model::job::Model) -> crate::JobResult< return Ok(()); }; - if let Err(e) = Context::request( + Context::request( Method::POST, job.target.as_deref().unwrap_or(""), Some(&serde_json::to_string(&payload.ld_context()).unwrap()), &job.actor, &key, ctx.domain() - ).await { - tracing::warn!("failed delivery of {} to {:?} : {e}", job.activity, job.target); - model::job::Entity::insert(job.clone().repeat(Some(e.to_string()))) - .exec(ctx.db()) - .await?; - } + ).await?; Ok(()) } diff --git a/upub/worker/src/dispatcher.rs b/upub/worker/src/dispatcher.rs index 8805de6..31ee2ca 100644 --- a/upub/worker/src/dispatcher.rs +++ b/upub/worker/src/dispatcher.rs @@ -17,11 +17,11 @@ pub enum JobError { #[error("malformed job: missing payload")] MissingPayload, - #[error("no available implementation to process job")] - Unprocessable, - #[error("error processing activity: {0:?}")] ProcessorError(#[from] upub::traits::process::ProcessorError), + + #[error("error delivering activity: {0}")] + DeliveryError(#[from] upub::traits::fetch::RequestError), } pub type JobResult = Result;