refactor: make grpc service able to be added dynamically (#3160)

This commit is contained in:
LFC
2024-01-15 12:33:27 +08:00
committed by GitHub
parent ca4d690424
commit 93f28c2a37
16 changed files with 245 additions and 261 deletions

View File

@@ -60,7 +60,7 @@ impl Services {
max_send_message_size: opts.max_send_message_size.as_bytes() as usize,
};
Ok(GrpcServerBuilder::new(grpc_runtime).config(grpc_config))
Ok(GrpcServerBuilder::new(grpc_config, grpc_runtime))
}
pub async fn build<T, U>(&self, opts: T, instance: Arc<U>) -> Result<ServerHandlers>
@@ -102,9 +102,8 @@ impl Services {
);
let grpc_server = builder
.database_handler(greptime_request_handler.clone())
.prometheus_handler(instance.clone())
.otlp_handler(instance.clone())
.user_provider(user_provider.clone())
.prometheus_handler(instance.clone(), user_provider.clone())
.otlp_handler(instance.clone(), user_provider.clone())
.flight_handler(Arc::new(greptime_request_handler))
.build();