Bump deps of webhook-axum

Otherwise some changes in axum's Router interface prevent teloxide's
webhook support from being used with up-to-date axum.
This commit is contained in:
Ilya Bizyaev 2024-07-14 18:42:30 +02:00
parent 9901a57472
commit 8ad1bd1928
No known key found for this signature in database
GPG key ID: 29AACC9F9F66C5B4
2 changed files with 6 additions and 6 deletions

View file

@ -112,9 +112,9 @@ sqlx = { version = "0.7.3", optional = true, default-features = false, features
redis = { version = "0.24", features = ["tokio-comp"], optional = true } redis = { version = "0.24", features = ["tokio-comp"], optional = true }
serde_cbor = { version = "0.11", optional = true } serde_cbor = { version = "0.11", optional = true }
bincode = { version = "1.3", optional = true } bincode = { version = "1.3", optional = true }
axum = { version = "0.6.0", optional = true } axum = { version = "0.7.0", optional = true }
tower = { version = "0.4.12", optional = true } tower = { version = "0.4.13", optional = true }
tower-http = { version = "0.3.4", features = ["trace"], optional = true } tower-http = { version = "0.5.2", features = ["trace"], optional = true }
rand = { version = "0.8.5", optional = true } rand = { version = "0.8.5", optional = true }
# HACK: ahash 0.8.7 bumped MSRV to 1.72, to keep MVSR 1.68 we need to depend on an older version. # HACK: ahash 0.8.7 bumped MSRV to 1.72, to keep MVSR 1.68 we need to depend on an older version.

View file

@ -47,13 +47,13 @@ where
<R as Requester>::DeleteWebhook: Send, <R as Requester>::DeleteWebhook: Send,
{ {
let Options { address, .. } = options; let Options { address, .. } = options;
let tcp_listener = tokio::net::TcpListener::bind(address).await.unwrap();
let (mut update_listener, stop_flag, app) = axum_to_router(bot, options).await?; let (mut update_listener, stop_flag, app) = axum_to_router(bot, options).await?;
let stop_token = update_listener.stop_token(); let stop_token = update_listener.stop_token();
tokio::spawn(async move { tokio::spawn(async move {
axum::Server::bind(&address) axum::serve(tcp_listener, app)
.serve(app.into_make_service())
.with_graceful_shutdown(stop_flag) .with_graceful_shutdown(stop_flag)
.await .await
.map_err(|err| { .map_err(|err| {
@ -90,7 +90,7 @@ where
/// [`delete_webhook`]: crate::payloads::DeleteWebhook /// [`delete_webhook`]: crate::payloads::DeleteWebhook
/// [`stop`]: crate::stop::StopToken::stop /// [`stop`]: crate::stop::StopToken::stop
/// [`options.address`]: Options::address /// [`options.address`]: Options::address
/// [`with_graceful_shutdown`]: axum::Server::with_graceful_shutdown /// [`with_graceful_shutdown`]: axum::serve::Serve::with_graceful_shutdown
/// ///
/// ## Returns /// ## Returns
/// ///