diff options
author | Alex Auvolat <alex@adnab.me> | 2022-09-07 17:54:16 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-09-07 17:54:16 +0200 |
commit | 2559f63e9bb58a66da70f33e852ebbd5f909876e (patch) | |
tree | c052d8d8978acd1396e3559015d0212fb1dbeb33 /src/api/admin | |
parent | 28d86e76021bed674ca78684b9522cfb664a8ae2 (diff) | |
download | garage-2559f63e9bb58a66da70f33e852ebbd5f909876e.tar.gz garage-2559f63e9bb58a66da70f33e852ebbd5f909876e.zip |
Make all HTTP services optionnal
Diffstat (limited to 'src/api/admin')
-rw-r--r-- | src/api/admin/api_server.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/api/admin/api_server.rs b/src/api/admin/api_server.rs index d871d4e2..fb0078cc 100644 --- a/src/api/admin/api_server.rs +++ b/src/api/admin/api_server.rs @@ -1,3 +1,4 @@ +use std::net::SocketAddr; use std::sync::Arc; use async_trait::async_trait; @@ -52,15 +53,15 @@ impl AdminApiServer { } } - pub async fn run(self, shutdown_signal: impl Future<Output = ()>) -> Result<(), GarageError> { - if let Some(bind_addr) = self.garage.config.admin.api_bind_addr { - let region = self.garage.config.s3_api.s3_region.clone(); - ApiServer::new(region, self) - .run_server(bind_addr, shutdown_signal) - .await - } else { - Ok(()) - } + pub async fn run( + self, + bind_addr: SocketAddr, + shutdown_signal: impl Future<Output = ()>, + ) -> Result<(), GarageError> { + let region = self.garage.config.s3_api.s3_region.clone(); + ApiServer::new(region, self) + .run_server(bind_addr, shutdown_signal) + .await } fn handle_options(&self, _req: &Request<Body>) -> Result<Response<Body>, Error> { |