diff --git a/backend/src/main.rs b/backend/src/main.rs index cbbb45713a..4328acf5a0 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -259,7 +259,7 @@ async fn windmill_main() -> anyhow::Result<()> { }; tracing::info!("Connecting to database..."); - let db = windmill_common::connect_db(server_mode).await?; + let db = windmill_common::connect_db(server_mode, indexer_mode).await?; tracing::info!("Database connected"); let num_version = sqlx::query_scalar!("SELECT version()").fetch_one(&db).await; diff --git a/backend/windmill-common/src/lib.rs b/backend/windmill-common/src/lib.rs index d4cd97409c..54b143fcac 100644 --- a/backend/windmill-common/src/lib.rs +++ b/backend/windmill-common/src/lib.rs @@ -47,6 +47,7 @@ pub mod tracing_init; pub const DEFAULT_MAX_CONNECTIONS_SERVER: u32 = 50; pub const DEFAULT_MAX_CONNECTIONS_WORKER: u32 = 5; +pub const DEFAULT_MAX_CONNECTIONS_INDEXER: u32 = 5; pub const DEFAULT_HUB_BASE_URL: &str = "https://hub.windmill.dev"; @@ -185,7 +186,10 @@ async fn reset() -> () { todo!() } -pub async fn connect_db(server_mode: bool) -> anyhow::Result> { +pub async fn connect_db( + server_mode: bool, + indexer_mode: bool, +) -> anyhow::Result> { use anyhow::Context; use std::env::var; use tokio::fs::File; @@ -211,12 +215,16 @@ pub async fn connect_db(server_mode: bool) -> anyhow::Result