diff --git a/.forgejo/workflows/botserver.yaml b/.forgejo/workflows/botserver.yaml index be101693a..92777f305 100644 --- a/.forgejo/workflows/botserver.yaml +++ b/.forgejo/workflows/botserver.yaml @@ -7,7 +7,7 @@ on: branches: ["main"] env: - CARGO_BUILD_JOBS: 2 + CARGO_BUILD_JOBS: 5 CARGO_NET_RETRY: 10 jobs: diff --git a/scripts/utils/set-limits.sh b/scripts/utils/set-limits.sh index 0b63ac7da..14f17f2d6 100644 --- a/scripts/utils/set-limits.sh +++ b/scripts/utils/set-limits.sh @@ -17,7 +17,7 @@ declare -A container_limits=( ["*bot*"]="2048MB:25ms/100ms" ["*oppbot*"]="4096MB:50ms/100ms" ["*meeting*"]="4096MB:100ms/100ms" - ["*alm*"]="2048MB:50ms/100ms" + ["*alm*"]="4048MB:200ms/100ms" ["*vault*"]="2048MB:50ms/100ms" ["*alm-ci*"]="8192MB:200ms/100ms" # CHANGED: 100ms → 200ms (HIGHEST PRIORITY) ["*system*"]="4096MB:50ms/100ms" @@ -45,7 +45,7 @@ declare -A container_priority=( ["*system*"]="5" # Normal priority ["*bot*"]="4" # Lower priority ["*doc-editor*"]="4" # Lower priority - ["*alm*"]="4" # Lower priority + ["*alm*"]="10" # Lower priority ["*mailer*"]="3" # Lowest priority ) diff --git a/src/core/bootstrap/mod.rs b/src/core/bootstrap/mod.rs index aef90970f..7dd698f7d 100644 --- a/src/core/bootstrap/mod.rs +++ b/src/core/bootstrap/mod.rs @@ -456,16 +456,24 @@ impl BootstrapManager { match pm.start("tables") { Ok(_child) => { let mut ready = false; + let pg_isready_path = self.stack_dir("bin/tables/bin/pg_isready"); for attempt in 1..=30 { tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; - let status = SafeCommand::new("pg_isready") - .and_then(|c| { - c.args(&["-h", "localhost", "-p", "5432"]) - }) - .ok() - .and_then(|cmd| cmd.execute().ok()) - .map(|o| o.status.success()) - .unwrap_or(false); + let pg_isready_exists = pg_isready_path.exists(); + let status = if pg_isready_exists { + safe_sh_command(&format!("{} -h localhost -p 5432", pg_isready_path.display())) + .map(|o| o.status.success()) + .unwrap_or(false) + } else { + SafeCommand::new("pg_isready") + .and_then(|c| { + c.args(&["-h", "localhost", "-p", "5432"]) + }) + .ok() + .and_then(|cmd| cmd.execute().ok()) + .map(|o| o.status.success()) + .unwrap_or(false) + }; if status { ready = true; info!("PostgreSQL started and ready (attempt {})", attempt); @@ -502,16 +510,24 @@ impl BootstrapManager { warn!("PostgreSQL might already be running: {}", e); let mut ready = false; + let pg_isready_path = self.stack_dir("bin/tables/bin/pg_isready"); for attempt in 1..=30 { tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; - let status = SafeCommand::new("pg_isready") - .and_then(|c| { - c.args(&["-h", "localhost", "-p", "5432"]) - }) - .ok() - .and_then(|cmd| cmd.execute().ok()) - .map(|o| o.status.success()) - .unwrap_or(false); + let pg_isready_exists = pg_isready_path.exists(); + let status = if pg_isready_exists { + safe_sh_command(&format!("{} -h localhost -p 5432", pg_isready_path.display())) + .map(|o| o.status.success()) + .unwrap_or(false) + } else { + SafeCommand::new("pg_isready") + .and_then(|c| { + c.args(&["-h", "localhost", "-p", "5432"]) + }) + .ok() + .and_then(|cmd| cmd.execute().ok()) + .map(|o| o.status.success()) + .unwrap_or(false) + }; if status { ready = true; info!("PostgreSQL is ready (attempt {})", attempt);