Skip to content

Commit

Permalink
Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesxu123 committed Feb 29, 2024
1 parent 361e015 commit 18e7695
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ simple_logger = "4.3.3"
tokio = { version = "1", features = ["full"] }
tokio-executor-trait = "2.1.1"
tokio-reactor-trait = "1.1.0"
sentry = "0.32.2"
5 changes: 4 additions & 1 deletion src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ pub async fn handle_queue_request(
ErrorTypes::ServiceDown => {
tokio::time::sleep(Duration::from_secs(10)).await;
delivery
.nack(BasicNackOptions { requeue: true, multiple: true })
.nack(BasicNackOptions {
requeue: true,
multiple: true,
})
.await
.expect("Failed to send reject");
}
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ async fn rabbit_mq() -> Result<(), Box<dyn Error>> {
#[tokio::main]
async fn main() {
simple_logger::SimpleLogger::new().env().init().unwrap();
let _guard = sentry::init(("https://1b28ead56fa7e331950400907c469ec7@o4506832412999680.ingest.sentry.io/4506832415031296", sentry::ClientOptions {
release: sentry::release_name!(),
..Default::default()
}));
let smtp_username = env::var("SMTP_USERNAME").expect("SMTP_USERNAME not in env");
let smtp_password = env::var("SMTP_PASSWORD").expect("SMTP_PASSWORD not in env");
let smtp_host = env::var("SMTP_HOST").expect("SMTP_HOST not in env");
Expand Down

0 comments on commit 18e7695

Please sign in to comment.