fix: blocking forever

Closes #102
Signed-off-by: bestgopher <84328409@qq.com>
This commit is contained in:
bestgopher
2024-10-29 20:48:33 +08:00
parent dd9abc1db0
commit 16d66a4206
4 changed files with 54 additions and 77 deletions
+1 -6
View File
@@ -1,26 +1,21 @@
pub mod error;
pub mod handlers;
pub mod object_api;
use axum::{extract::Request, response::Response, routing::get, BoxError, Router};
use ecstore::store::ECStore;
use error::ErrorCode;
use handlers::list_pools;
use object_api::ObjectApi;
use tower::Service;
pub type Result<T> = std::result::Result<T, ErrorCode>;
const API_VERSION: &str = "/v3";
pub fn register_admin_router(
ec_store: Option<ECStore>,
) -> impl Service<Request, Response = Response, Error: Into<BoxError>, Future: Send> + Clone {
pub fn register_admin_router() -> impl Service<Request, Response = Response, Error: Into<BoxError>, Future: Send> + Clone {
Router::new()
.nest(
"/rustfs/admin",
Router::new().nest(API_VERSION, Router::new().route("/pools/list", get(list_pools::handler))),
)
.with_state::<()>(ObjectApi::new(ec_store))
.into_service()
}