continue tracing impl

This commit is contained in:
2026-06-09 21:17:03 +00:00
parent 39c2afa0a7
commit efb35d5a8a
7 changed files with 40 additions and 12 deletions
+7 -5
View File
@@ -1,12 +1,11 @@
use serde::Deserialize;
use std::time::Duration;
use tracing::{error, info};
use crate::{
env::EnvConfig,
gitea::{GiteaAPI, WebhookType},
open_router::OpenRouterClient,
};
use serde::Deserialize;
use std::time::Duration;
use tracing::{error, info, instrument};
#[derive(Deserialize, Debug)]
pub struct ReviewResult {
@@ -59,10 +58,13 @@ impl Bot {
self.exec(wb).await;
}
info!("Bot shutting down, channel closed");
Ok(())
}
#[instrument(skip(self))]
pub async fn exec(&self, webhook: WebhookType) {
tracing::Span::current().record("webhook_type", tracing::field::debug(&webhook));
let exec_result = match webhook {
WebhookType::Review(review_payload) => crate::bot_actions::review::exec_review(
&self.gitea_api,
@@ -77,7 +79,7 @@ impl Bot {
match exec_result {
Ok(_) => info!("Task completed"),
Err(err) => {
error!("{}", err);
error!(%err, "Task error");
sentry_anyhow::capture_anyhow(&err);
}
}