diff --git a/services/blob/src/config.rs b/services/blob/src/config.rs --- a/services/blob/src/config.rs +++ b/services/blob/src/config.rs @@ -4,15 +4,15 @@ use tracing::info; use crate::constants::{ - AWS_REGION, GRPC_SERVER_DEFAULT_PORT, LOCALSTACK_URL, SANDBOX_ENV_VAR, + AWS_REGION, DEFAULT_LISTEN_PORT, LOCALSTACK_URL, SANDBOX_ENV_VAR, }; #[derive(Parser)] #[command(version, about, long_about = None)] pub struct AppConfig { - /// gRPC server listening port - #[arg(long = "port", default_value_t = GRPC_SERVER_DEFAULT_PORT)] - pub grpc_port: u64, + /// HTTP/gRPC server listening port + #[arg(long = "port", default_value_t = DEFAULT_LISTEN_PORT)] + pub listen_port: u16, /// Run the service in sandbox #[arg(long = "sandbox", default_value_t = false)] // support the env var for compatibility reasons diff --git a/services/blob/src/constants.rs b/services/blob/src/constants.rs --- a/services/blob/src/constants.rs +++ b/services/blob/src/constants.rs @@ -1,6 +1,6 @@ // Assorted constants -pub const GRPC_SERVER_DEFAULT_PORT: u64 = 50051; +pub const DEFAULT_LISTEN_PORT: u16 = 50051; pub const AWS_REGION: &str = "us-east-2"; pub const LOCALSTACK_URL: &str = "http://localstack:4566"; pub const MPSC_CHANNEL_BUFFER_CAPACITY: usize = 1; diff --git a/services/blob/src/grpc.rs b/services/blob/src/grpc.rs --- a/services/blob/src/grpc.rs +++ b/services/blob/src/grpc.rs @@ -28,10 +28,10 @@ db_client: DatabaseClient, s3_client: S3Client, ) -> Result<()> { - let addr: SocketAddr = format!("[::]:{}", CONFIG.grpc_port).parse()?; + let addr: SocketAddr = format!("[::]:{}", CONFIG.listen_port).parse()?; let blob_service = MyBlobService::new(db_client, s3_client); - info!("Starting gRPC server listening at {}", CONFIG.grpc_port); + info!("Starting gRPC server listening at {}", CONFIG.listen_port); Server::builder() .add_service(BlobServiceServer::new(blob_service)) .serve(addr)