use std::error::Error; use crate::sync::event::PostReceiveTask; #[async_trait::async_trait] pub trait WebhookTx: Send + Sync { async fn dispatch(&self, task: &PostReceiveTask) -> Result<(), Box>; } #[derive(Debug, Default, Clone)] pub struct NoopWebhookTx; #[async_trait::async_trait] impl WebhookTx for NoopWebhookTx { async fn dispatch(&self, task: &PostReceiveTask) -> Result<(), Box> { tracing::warn!( repo_id = %task.repo_id, refs = task.refs.len(), "webhook dispatch not configured; message dropped (NoopWebhookTx)" ); Ok(()) } }