Skip to content

Commit

Permalink
chore: review remark
Browse files Browse the repository at this point in the history
  • Loading branch information
Vovke committed Oct 25, 2024
1 parent 6dbb38f commit 4cc2713
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 39 deletions.
15 changes: 0 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ axum = { version = "0.7", default-features = false, features = [
"matched-path",
] }
tracing-subscriber = { version = "0.3", features = ["env-filter", "time"] }
ureq = { version = "2", default-features = false, features = ["json"] }
names = { version = "0.14", default-features = false }
tokio-util = { version = "0.7", features = ["rt"] }
tokio = { version = "1", features = ["rt-multi-thread", "signal", "time"] }
Expand Down
16 changes: 0 additions & 16 deletions src/callback.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
mod arguments;
mod callback;
mod chain;
mod database;
mod definitions;
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use utils::{
};

mod arguments;
mod callback;
mod chain;
mod database;
mod definitions;
Expand Down
6 changes: 3 additions & 3 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ impl State {
// Only perform actions if the record is saved in ledger
match state.db.mark_paid(id.clone()).await {
Ok(order) => {
if let Some(callback) = order.callback.clone() {
if !order.callback.is_empty() {
let callback = order.callback.clone();
tokio::spawn(async move {
tracing::info!("Sending callback to: {}", callback);
let client = reqwest::Client::new();

// fire and forget
if let Err(e) = client.get(&callback).send().await {
if let Err(e) = reqwest::Client::new().get(&callback).send().await {
tracing::error!("Failed to send callback to {}: {:?}", callback, e);
}
});
Expand Down
3 changes: 1 addition & 2 deletions src/utils/logger.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use super::shutdown;
use crate::{callback, database, error::Error, server};
use crate::{database, error::Error, server};
use tracing_subscriber::{fmt::time::UtcTime, EnvFilter};

const TARGETS: &[&str] = &[
callback::MODULE,
database::MODULE,
server::MODULE,
shutdown::MODULE,
Expand Down

0 comments on commit 4cc2713

Please sign in to comment.