From b0360b4a39657bf41ace79925d9d398086d0b730 Mon Sep 17 00:00:00 2001 From: Javier Torres Date: Tue, 23 Jan 2024 15:59:58 +0100 Subject: [PATCH] Remove empty initializers --- nucliadb_node/src/bin/reader.rs | 1 - nucliadb_node/src/bin/writer.rs | 1 - nucliadb_node/src/grpc/grpc_reader.rs | 5 ----- nucliadb_node/src/grpc/grpc_writer.rs | 5 ----- nucliadb_node/src/replication/service.rs | 5 ----- nucliadb_node/tests/common/node_services.rs | 8 -------- 6 files changed, 25 deletions(-) diff --git a/nucliadb_node/src/bin/reader.rs b/nucliadb_node/src/bin/reader.rs index 881bee4c04..1e009d6a97 100644 --- a/nucliadb_node/src/bin/reader.rs +++ b/nucliadb_node/src/bin/reader.rs @@ -131,7 +131,6 @@ pub async fn start_grpc_service( tokio::spawn(health_checker(health_reporter, settings.clone())); let grpc_driver = NodeReaderGRPCDriver::new(settings.clone()); - grpc_driver.initialize().await?; Server::builder() .layer(tracing_middleware) diff --git a/nucliadb_node/src/bin/writer.rs b/nucliadb_node/src/bin/writer.rs index 634fc08649..454ecabc41 100644 --- a/nucliadb_node/src/bin/writer.rs +++ b/nucliadb_node/src/bin/writer.rs @@ -188,7 +188,6 @@ pub async fn start_grpc_service( if settings.node_role() == NodeRole::Primary { let grpc_driver = NodeWriterGRPCDriver::new(settings.clone(), shard_cache.clone()) .with_sender(metadata_sender); - grpc_driver.initialize().await?; server_builder = server_builder.add_service(GrpcServer::new(grpc_driver)); } let replication_server = replication::replication_service_server::ReplicationServiceServer::new( diff --git a/nucliadb_node/src/grpc/grpc_reader.rs b/nucliadb_node/src/grpc/grpc_reader.rs index 35edee8a6e..e7bde881e5 100644 --- a/nucliadb_node/src/grpc/grpc_reader.rs +++ b/nucliadb_node/src/grpc/grpc_reader.rs @@ -45,11 +45,6 @@ impl NodeReaderGRPCDriver { } } - /// This function must be called before using this service - pub async fn initialize(&self) -> NodeResult<()> { - Ok(()) - } - async fn obtain_shard(&self, id: impl Into) -> Result, tonic::Status> { let id = id.into(); let id_clone = id.clone(); diff --git a/nucliadb_node/src/grpc/grpc_writer.rs b/nucliadb_node/src/grpc/grpc_writer.rs index 14214b5cf8..9ed1abebd5 100644 --- a/nucliadb_node/src/grpc/grpc_writer.rs +++ b/nucliadb_node/src/grpc/grpc_writer.rs @@ -62,11 +62,6 @@ impl NodeWriterGRPCDriver { } } - /// This function must be called before using this service - pub async fn initialize(&self) -> NodeResult<()> { - Ok(()) - } - pub fn with_sender(self, sender: UnboundedSender) -> Self { Self { sender: Some(sender), diff --git a/nucliadb_node/src/replication/service.rs b/nucliadb_node/src/replication/service.rs index b476774277..3401daae5c 100644 --- a/nucliadb_node/src/replication/service.rs +++ b/nucliadb_node/src/replication/service.rs @@ -49,11 +49,6 @@ impl ReplicationServiceGRPCDriver { node_id, } } - - /// This function must be called before using this service - pub async fn initialize(&self) -> NodeResult<()> { - Ok(()) - } } async fn stream_file( diff --git a/nucliadb_node/tests/common/node_services.rs b/nucliadb_node/tests/common/node_services.rs index e956833328..d6046495dd 100644 --- a/nucliadb_node/tests/common/node_services.rs +++ b/nucliadb_node/tests/common/node_services.rs @@ -255,10 +255,6 @@ impl NodeFixture { self.reader_server_task = Some(tokio::spawn(async move { lifecycle::initialize_reader(settings.clone()); let grpc_driver = NodeReaderGRPCDriver::new(settings.clone()); - grpc_driver - .initialize() - .await - .expect("Unable to initialize reader gRPC"); let reader_server = NodeReaderServer::new(grpc_driver); Server::builder() .add_service(reader_server) @@ -289,10 +285,6 @@ impl NodeFixture { self.reader_server_task = Some(tokio::spawn(async move { lifecycle::initialize_reader(settings.clone()); let grpc_driver = NodeReaderGRPCDriver::new(settings.clone()); - grpc_driver - .initialize() - .await - .expect("Unable to initialize reader gRPC"); let reader_server = NodeReaderServer::new(grpc_driver); Server::builder() .add_service(reader_server)