mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-31 12:20:38 +00:00
refactor: remove some async in ServerHandlers (#6057)
* refactor: remove some async in ServerHandlers * address PR comments
This commit is contained in:
@@ -129,7 +129,7 @@ impl Datanode {
|
||||
self.services = services;
|
||||
}
|
||||
|
||||
pub async fn shutdown(&self) -> Result<()> {
|
||||
pub async fn shutdown(&mut self) -> Result<()> {
|
||||
self.services
|
||||
.shutdown_all()
|
||||
.await
|
||||
|
||||
@@ -62,7 +62,7 @@ impl<'a> DatanodeServiceBuilder<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn build(mut self) -> Result<ServerHandlers> {
|
||||
pub fn build(mut self) -> Result<ServerHandlers> {
|
||||
let handlers = ServerHandlers::default();
|
||||
|
||||
if let Some(grpc_server) = self.grpc_server.take() {
|
||||
@@ -70,7 +70,7 @@ impl<'a> DatanodeServiceBuilder<'a> {
|
||||
addr: &self.opts.grpc.bind_addr,
|
||||
})?;
|
||||
let handler: ServerHandler = (Box::new(grpc_server), addr);
|
||||
handlers.insert(handler).await;
|
||||
handlers.insert(handler);
|
||||
}
|
||||
|
||||
if self.enable_http_service {
|
||||
@@ -82,7 +82,7 @@ impl<'a> DatanodeServiceBuilder<'a> {
|
||||
addr: &self.opts.http.addr,
|
||||
})?;
|
||||
let handler: ServerHandler = (Box::new(http_server), addr);
|
||||
handlers.insert(handler).await;
|
||||
handlers.insert(handler);
|
||||
}
|
||||
|
||||
Ok(handlers)
|
||||
|
||||
Reference in New Issue
Block a user