fix(main): update dns_init startup logic and remove unused code in http.rs (#531)

- Refactored the DNS resolver initialization logic in `main.rs` for improved startup reliability and error handling.
- Removed unused code from `http.rs` to keep the codebase clean and maintainable.
This commit is contained in:
houseme
2025-09-13 23:43:25 +08:00
committed by GitHub
parent 0c3079ae5e
commit 73f0ecbf8f
2 changed files with 3 additions and 4 deletions

View File

@@ -136,6 +136,9 @@ async fn run(opt: config::Opt) -> Result<()> {
set_global_addr(&opt.address).await;
// Wait for DNS initialization to complete before network-heavy operations
dns_init.await.map_err(Error::other)?;
// For RPC
let (endpoint_pools, setup_type) = EndpointServerPools::from_volumes(server_address.clone().as_str(), opt.volumes.clone())
.await
@@ -230,9 +233,6 @@ async fn run(opt: config::Opt) -> Result<()> {
// Initialize event notifier
init_event_notifier().await;
// Wait for DNS initialization to complete before network-heavy operations
dns_init.await.map_err(Error::other)?;
let buckets_list = store
.list_bucket(&BucketOptions {
no_metadata: true,

View File

@@ -128,7 +128,6 @@ pub async fn start_http_server(
) -> Result<tokio::sync::broadcast::Sender<()>> {
let server_addr = parse_and_resolve_address(opt.address.as_str()).map_err(Error::other)?;
let server_port = server_addr.port();
let _server_address = server_addr.to_string();
// The listening address and port are obtained from the parameters
let listener = {