From 5ce9ffd6ffda78ffbedb68148d3c9a56ec868ed1 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Mon, 6 May 2024 22:53:05 +0200 Subject: [PATCH] Fix --- Cargo.lock | 1 + Cargo.toml | 3 ++- src/core/file_utils.rs | 4 ---- src/main.rs | 7 ++++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8588d86..bf9247a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1911,6 +1911,7 @@ dependencies = [ "once_cell", "reqwest 0.11.23", "sentry", + "sentry-tracing", "serde", "serde_json", "teloxide", diff --git a/Cargo.toml b/Cargo.toml index 576061e..598d6bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,9 +13,10 @@ axum_typed_multipart = "0.11.1" tracing = "0.1.40" tracing-subscriber = { version = "0.3.18", features = ["env-filter"]} tower-http = { version = "0.5.2", features = ["trace"] } +sentry-tracing = "0.32.3" tokio = "1.37.0" -tokio-util = { version = "0.7.11", features = [ "full" ] } +tokio-util = { version = "0.7.11", features = [ "full" ] } axum-prometheus = "0.6.1" futures = "0.3.30" diff --git a/src/core/file_utils.rs b/src/core/file_utils.rs index 53658be..eb3914e 100644 --- a/src/core/file_utils.rs +++ b/src/core/file_utils.rs @@ -68,10 +68,6 @@ pub async fn download_file(chat_id: i64, message_id: i32) -> Option { - if message.document() == None { - return None; - } - let file_id = match message.document() { Some(v) => v.file.id.clone(), None => { diff --git a/src/main.rs b/src/main.rs index 17eb6c1..42bf557 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ mod core; use std::{net::SocketAddr, str::FromStr}; use sentry::{integrations::debug_images::DebugImagesIntegration, types::Dsn, ClientOptions}; +use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; use crate::core::views::get_router; @@ -20,9 +21,9 @@ async fn main() { let _guard = sentry::init(options); - tracing_subscriber::fmt() - .with_target(false) - .compact() + tracing_subscriber::registry() + .with(tracing_subscriber::fmt::layer()) + .with(sentry_tracing::layer()) .init(); let addr = SocketAddr::from(([0, 0, 0, 0], 8080));