From 2c4eb46e65dfed981c0fce1acf35ea36225c6063 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 4 Feb 2024 18:32:14 +0100 Subject: [PATCH] fix: decrease database connections of workers to 3 --- backend/windmill-api/src/concurrency_groups.rs | 3 +++ backend/windmill-api/src/oidc.rs | 2 ++ backend/windmill-common/src/lib.rs | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/windmill-api/src/concurrency_groups.rs b/backend/windmill-api/src/concurrency_groups.rs index 57a0941492..d66da5417f 100644 --- a/backend/windmill-api/src/concurrency_groups.rs +++ b/backend/windmill-api/src/concurrency_groups.rs @@ -21,12 +21,14 @@ pub fn global_service() -> Router { Router::new() } +#[cfg(feature = "enterprise")] #[derive(Serialize)] pub struct ConcurrencyGroups { concurrency_id: String, job_uuids: Vec, } +#[cfg(feature = "enterprise")] async fn list_concurrency_groups( authed: ApiAuthed, Extension(db): Extension, @@ -66,6 +68,7 @@ async fn list_concurrency_groups( return Ok(Json(concurrency_groups)); } +#[cfg(feature = "enterprise")] async fn delete_concurrency_group( authed: ApiAuthed, Extension(db): Extension, diff --git a/backend/windmill-api/src/oidc.rs b/backend/windmill-api/src/oidc.rs index 9bb1549e58..917c144a14 100644 --- a/backend/windmill-api/src/oidc.rs +++ b/backend/windmill-api/src/oidc.rs @@ -54,11 +54,13 @@ pub fn workspaced_service() -> Router { Router::new().route("/token/:audience", post(gen_token)) } +#[cfg(feature = "enterprise")] #[derive(Debug, Clone, serde::Serialize)] struct Keys { private_key: String, } +#[cfg(feature = "enterprise")] async fn gen_pems(db: &DB) -> anyhow::Result { let private_key_cmd = Command::new("openssl") .arg("genrsa") diff --git a/backend/windmill-common/src/lib.rs b/backend/windmill-common/src/lib.rs index 091cbc0254..e5631e59e7 100644 --- a/backend/windmill-common/src/lib.rs +++ b/backend/windmill-common/src/lib.rs @@ -42,7 +42,7 @@ pub mod workspaces; 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_WORKER: u32 = 3; lazy_static::lazy_static! { pub static ref METRICS_PORT: u16 = std::env::var("METRICS_PORT")