This commit is contained in:
2024-04-25 17:34:08 +02:00
parent 9b30f6efa8
commit fb3a3acf51
3 changed files with 617 additions and 492 deletions

1065
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,31 +6,31 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
tokio = { version = "1.36.0", features = ["rt-multi-thread", "macros"] } tokio = { version = "1.37.0", features = ["rt-multi-thread", "macros"] }
reqwest = { version = "0.11.22", features = ["json"] } reqwest = { version = "0.12.4", features = ["json", "stream"] }
serde = { version = "1.0.193", features = ["derive"] } serde = { version = "1.0.198", features = ["derive"] }
serde_json = "1.0.108" serde_json = "1.0.116"
teloxide = { version = "0.12.2", features = ["macros", "webhooks-axum", "cache-me", "throttle"] } teloxide = { version = "0.12.2", features = ["macros", "webhooks-axum", "cache-me", "throttle"] }
url = "2.5.0" url = "2.5.0"
ctrlc = { version = "3.4.1", features = ["termination"] } ctrlc = { version = "3.4.4", features = ["termination"] }
strum = "0.25.0" strum = "0.26.2"
strum_macros = "0.25.3" strum_macros = "0.26.2"
futures = "0.3.29" futures = "0.3.30"
base64 = "0.21.5" base64 = "0.22.0"
tokio-util = { version = "0.7.10", features = ["compat"] } tokio-util = { version = "0.7.10", features = ["compat"] }
textwrap = "0.16.0" textwrap = "0.16.1"
regex = "1.10.2" regex = "1.10.4"
chrono = "0.4.31" chrono = "0.4.38"
dateparser = "0.2.1" dateparser = "0.2.1"
sentry = { version = "0.32.0", features = ["debug-images"] } sentry = { version = "0.32.3", features = ["debug-images"] }
moka = { version = "0.12.1", features = ["future"] } moka = { version = "0.12.7", features = ["future"] }
axum = "0.6.20" axum = "0.7.5"
smallvec = { version = "1.11.2", features = ["serde"] } smallvec = { version = "1.13.2", features = ["serde"] }
smartstring = { version = "1.0.1", features = ["serde"] } smartstring = { version = "1.0.1", features = ["serde"] }
tokio-stream = "0.1.14" tokio-stream = "0.1.15"
tracing = "0.1.40" tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"]} tracing-subscriber = { version = "0.3.18", features = ["env-filter"]}
tower = "0.4.13" tower = "0.4.13"
tower-http = { version = "0.4.4", features = ["trace"] } tower-http = { version = "0.5.2", features = ["trace"] }
once_cell = "1.19.0" once_cell = "1.19.0"
axum-prometheus = "0.4.0" axum-prometheus = "0.6.1"

View File

@@ -115,9 +115,9 @@ pub async fn start_axum_server(stop_signal: Arc<AtomicBool>) {
log::info!("Start webserver..."); log::info!("Start webserver...");
let addr = SocketAddr::from(([0, 0, 0, 0], config::CONFIG.webhook_port)); let addr = SocketAddr::from(([0, 0, 0, 0], config::CONFIG.webhook_port));
let listener = tokio::net::TcpListener::bind(addr).await.unwrap();
axum::Server::bind(&addr) axum::serve(listener, router)
.serve(router.into_make_service())
.with_graceful_shutdown(async move { .with_graceful_shutdown(async move {
let mut interval = time::interval(Duration::from_secs(1)); let mut interval = time::interval(Duration::from_secs(1));
@@ -130,7 +130,7 @@ pub async fn start_axum_server(stop_signal: Arc<AtomicBool>) {
} }
}) })
.await .await
.expect("Axum server error"); .unwrap();
log::info!("Webserver shutdown..."); log::info!("Webserver shutdown...");
}); });