mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
chore: Update incompatible dependenceis
This commit is contained in:
@@ -4,7 +4,7 @@ use axum::{
|
||||
Router,
|
||||
extract::{DefaultBodyLimit, MatchedPath},
|
||||
};
|
||||
use axum_client_ip::SecureClientIpSource;
|
||||
use axum_client_ip::ClientIpSource;
|
||||
use conduwuit::{Result, Server, debug, error};
|
||||
use conduwuit_service::{Services, state::Guard};
|
||||
use http::{
|
||||
@@ -59,7 +59,7 @@ pub(crate) fn build(services: &Arc<Services>) -> Result<(Router, Guard)> {
|
||||
.on_response(DefaultOnResponse::new().level(Level::DEBUG)),
|
||||
)
|
||||
.layer(axum::middleware::from_fn_with_state(Arc::clone(services), request::handle))
|
||||
.layer(SecureClientIpSource::ConnectInfo.into_extension())
|
||||
.layer(ClientIpSource::ConnectInfo.into_extension())
|
||||
.layer(ResponseBodyTimeoutLayer::new(Duration::from_secs(
|
||||
server.config.client_response_timeout,
|
||||
)))
|
||||
|
||||
+7
-3
@@ -7,7 +7,7 @@ use std::{
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use axum_server::Handle as ServerHandle;
|
||||
use axum_server::{Address, Handle as ServerHandle};
|
||||
use conduwuit::{Error, Result, Server, debug, debug_error, debug_info, error, info};
|
||||
use futures::FutureExt;
|
||||
use service::Services;
|
||||
@@ -117,7 +117,7 @@ pub(crate) async fn stop(services: Arc<Services>) -> Result<()> {
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip_all, level = "info")]
|
||||
async fn signal(server: Arc<Server>, tx: Sender<()>, handle: axum_server::Handle) {
|
||||
async fn signal<A: Address>(server: Arc<Server>, tx: Sender<()>, handle: axum_server::Handle<A>) {
|
||||
server
|
||||
.clone()
|
||||
.until_shutdown()
|
||||
@@ -125,7 +125,11 @@ async fn signal(server: Arc<Server>, tx: Sender<()>, handle: axum_server::Handle
|
||||
.await;
|
||||
}
|
||||
|
||||
async fn handle_shutdown(server: Arc<Server>, tx: Sender<()>, handle: axum_server::Handle) {
|
||||
async fn handle_shutdown<A: Address>(
|
||||
server: Arc<Server>,
|
||||
tx: Sender<()>,
|
||||
handle: axum_server::Handle<A>,
|
||||
) {
|
||||
if let Err(e) = tx.send(()) {
|
||||
error!("failed sending shutdown transaction to channel: {e}");
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ use super::layers;
|
||||
/// Serve clients
|
||||
pub(super) async fn serve(
|
||||
services: Arc<Services>,
|
||||
handle: ServerHandle,
|
||||
handle: ServerHandle<std::net::SocketAddr>,
|
||||
mut shutdown: broadcast::Receiver<()>,
|
||||
) -> Result {
|
||||
let server = &services.server;
|
||||
|
||||
@@ -11,7 +11,7 @@ use tokio::task::JoinSet;
|
||||
pub(super) async fn serve(
|
||||
server: &Arc<Server>,
|
||||
app: Router,
|
||||
handle: ServerHandle,
|
||||
handle: ServerHandle<SocketAddr>,
|
||||
addrs: Vec<SocketAddr>,
|
||||
) -> Result<()> {
|
||||
let app = app.into_make_service_with_connect_info::<SocketAddr>();
|
||||
|
||||
Reference in New Issue
Block a user