From 57340d0240a51c78d7ea065df7900184c9141899 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Thu, 10 Aug 2023 21:17:00 +0200 Subject: [PATCH] Fix --- Cargo.toml | 2 +- src/main.rs | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 21ff01a..6f0836a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ futures = "0.3.28" reqwest = { version = "0.11.18", features = ["stream"] } tokio-util = { version = "0.7.8", features = ["compat"] } async-compression = { version = "0.4.0", features = ["futures-io", "gzip"] } -sentry = "0.31.3" +sentry = { version = "0.31.3", features = ["debug-images"] } lazy_static = "1.4.0" log = "0.4.18" env_logger = "0.10.0" diff --git a/src/main.rs b/src/main.rs index a5f301c..cca92bf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,8 +6,9 @@ pub mod types; pub mod utils; pub mod updater; -use std::net::SocketAddr; +use std::{net::SocketAddr, str::FromStr}; use axum::{Router, routing::post, http::HeaderMap}; +use sentry::{ClientOptions, types::Dsn, integrations::debug_images::DebugImagesIntegration}; use crate::updater::cron_jobs; @@ -49,9 +50,17 @@ async fn start_app() { #[tokio::main] async fn main() { - let _guard = sentry::init(config::CONFIG.sentry_dsn.clone()); env_logger::init(); + let options = ClientOptions { + dsn: Some(Dsn::from_str(&config::CONFIG.sentry_dsn).unwrap()), + default_integrations: false, + ..Default::default() + } + .add_integration(DebugImagesIntegration::new()); + + let _guard = sentry::init(options); + tokio::join![ cron_jobs(), start_app()