From e261ddf204ea9b845fe5c59685ae515a78aa42ba Mon Sep 17 00:00:00 2001 From: Rim Rakhimov Date: Mon, 16 Oct 2023 22:28:19 +0300 Subject: [PATCH] Launcher minor updates (#633) * Bump maximal tonic version to v0.10 * Make database initialization function to return DatabaseConnection --- libs/blockscout-service-launcher/Cargo.toml | 2 +- libs/blockscout-service-launcher/src/database.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/blockscout-service-launcher/Cargo.toml b/libs/blockscout-service-launcher/Cargo.toml index c52691668..07c1276c7 100644 --- a/libs/blockscout-service-launcher/Cargo.toml +++ b/libs/blockscout-service-launcher/Cargo.toml @@ -24,7 +24,7 @@ prometheus = { version = "0.13", optional = true } reqwest = { version = "0.11", features = ["json"], optional = true } serde = { version = "1.0", features = ["derive"], optional = true } tokio = { version = "1", optional = true } -tonic = { version = ">= 0.8, < 0.10", optional = true } +tonic = { version = ">= 0.8, < 0.11", optional = true } tracing = { version = "0.1", optional = true } tracing-opentelemetry = { version = "0.19", optional = true } tracing-subscriber = { version = "0.3", features = ["env-filter", "json"], optional = true } diff --git a/libs/blockscout-service-launcher/src/database.rs b/libs/blockscout-service-launcher/src/database.rs index 19c4cba11..95534618e 100644 --- a/libs/blockscout-service-launcher/src/database.rs +++ b/libs/blockscout-service-launcher/src/database.rs @@ -25,7 +25,7 @@ pub async fn initialize_postgres( connect_options: impl Into, create_database: bool, run_migrations: bool, -) -> anyhow::Result<()> { +) -> anyhow::Result { let connect_options = connect_options.into(); // Create database if not exists @@ -75,7 +75,7 @@ pub async fn initialize_postgres( Migrator::up(&db, None).await?; } - Ok(()) + Ok(db) } fn with_connect_options(url: impl Into, source_options: &ConnectOptions) -> ConnectOptions {