From 6cca3afd9787aade076f605f8e218a10e5621f30 Mon Sep 17 00:00:00 2001 From: Ricky Chilcott Date: Fri, 19 Jul 2024 13:07:24 -0400 Subject: [PATCH] Print DB Config for debugging --- .github/workflows/build.yml | 1 + spec/dummy/config/database.yml | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index abf4a607..49411e1b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,6 +94,7 @@ jobs: DB: "${{ matrix.db }}" DB_USERNAME: thredded DB_PASSWORD: thredded + DB_POOL: 1 steps: - uses: actions/checkout@v4 diff --git a/spec/dummy/config/database.yml b/spec/dummy/config/database.yml index 5001d1aa..5a23b1c8 100644 --- a/spec/dummy/config/database.yml +++ b/spec/dummy/config/database.yml @@ -4,12 +4,14 @@ db_host = ENV.fetch('DB_HOST', ENV.fetch('DB_1_PORT_5432_TCP_ADDR', 'localhos db_port = ENV['DB_1_PORT_5432_TCP_PORT'] || ENV['DB_PORT'] || {'postgresql' => 5432, 'mysql2' => 3306}[db_adapter] require 'etc' -pool_size = ENV['DB_POOL'] || ( +db_pool_size = ENV['DB_POOL'] || ( # Web: max workers * max threads ENV.fetch('WEB_CONCURRENCY', 3).to_i * ENV.fetch('MAX_THREADS', 5).to_i + # ActiveJob Async max thread pool size Etc.nprocessors ) + + puts "DATABASE CONFIGURATION", db_adapter, db_host, db_port, db_pool_size %> defaults: &defaults @@ -17,7 +19,7 @@ defaults: &defaults port: <%= db_port %> adapter: <%= db_adapter %> min_messages: WARNING - pool: <%= pool_size %> + pool: <%= db_pool_size %> username: <%= ENV.fetch('DB_USERNAME', 'thredded').inspect %> password: <%= ENV.fetch('DB_PASSWORD', 'thredded').inspect %> encoding: <%= db_adapter == 'mysql2' ? "utf8mb4\n charset: utf8mb4\n collation: utf8mb4_unicode_ci" : 'utf8' %>