Add Sentry integration
This commit is contained in:
parent
bcf174cd1e
commit
951a33fae9
987
Cargo.lock
generated
987
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
|||||||
name = "labrinth"
|
name = "labrinth"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
#Team members, please add your emails and usernames
|
#Team members, please add your emails and usernames
|
||||||
authors = ["geometrically <jai.a@tuta.io>", "Redblueflame <contact@redblueflame.com>", "Aeledfyr <aeledfyr@gmail.com>", "Charalampos Fanoulis <yo@fanoulis.dev>"]
|
authors = ["geometrically <jai.a@tuta.io>", "Redblueflame <contact@redblueflame.com>", "Aeledfyr <aeledfyr@gmail.com>", "Charalampos Fanoulis <yo@fanoulis.dev>", "AppleTheGolden <scotsbox@protonmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
@ -44,4 +44,7 @@ futures-timer = "3.0.2"
|
|||||||
rust-s3 = "0.26.1"
|
rust-s3 = "0.26.1"
|
||||||
async-trait = "0.1.41"
|
async-trait = "0.1.41"
|
||||||
|
|
||||||
sqlx = { version = "0.4.2", features = ["runtime-actix-rustls", "postgres", "chrono", "offline", "macros", "migrate"] }
|
sqlx = { version = "0.4.2", features = ["runtime-actix-rustls", "postgres", "chrono", "offline", "macros", "migrate"] }
|
||||||
|
|
||||||
|
sentry = { version = "0.22.0", features = ["log"] }
|
||||||
|
sentry-actix = "0.22.0"
|
||||||
|
|||||||
@ -86,6 +86,14 @@ async fn main() -> std::io::Result<()> {
|
|||||||
info!("Skipping initial indexing");
|
info!("Skipping initial indexing");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DSN is from SENTRY_DSN env variable.
|
||||||
|
// Has no effect if not set.
|
||||||
|
let sentry = sentry::init(());
|
||||||
|
if sentry.is_enabled() {
|
||||||
|
info!("Enabled Sentry integration");
|
||||||
|
std::env::set_var("RUST_BACKTRACE", "1");
|
||||||
|
}
|
||||||
|
|
||||||
database::check_for_migrations()
|
database::check_for_migrations()
|
||||||
.await
|
.await
|
||||||
.expect("An error occurred while running migrations.");
|
.expect("An error occurred while running migrations.");
|
||||||
@ -283,6 +291,7 @@ async fn main() -> std::io::Result<()> {
|
|||||||
.with_interval(std::time::Duration::from_secs(60))
|
.with_interval(std::time::Duration::from_secs(60))
|
||||||
.with_max_requests(200),
|
.with_max_requests(200),
|
||||||
)
|
)
|
||||||
|
.wrap(sentry_actix::Sentry::new())
|
||||||
.data(pool.clone())
|
.data(pool.clone())
|
||||||
.data(file_host.clone())
|
.data(file_host.clone())
|
||||||
.data(indexing_queue.clone())
|
.data(indexing_queue.clone())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user