feat(core): Add mysql pool size and increase it for CI (no-changelog) (#19347)

This commit is contained in:
Daria
2025-09-11 11:14:02 +03:00
committed by GitHub
parent c4f41bb534
commit 12f12da288
5 changed files with 12 additions and 0 deletions

View File

@@ -62,6 +62,7 @@ jobs:
timeout-minutes: 20 timeout-minutes: 20
env: env:
DB_MYSQLDB_PASSWORD: password DB_MYSQLDB_PASSWORD: password
DB_MYSQLDB_POOL_SIZE: 20
steps: steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -86,6 +87,7 @@ jobs:
timeout-minutes: 20 timeout-minutes: 20
env: env:
DB_MYSQLDB_PASSWORD: password DB_MYSQLDB_PASSWORD: password
DB_MYSQLDB_POOL_SIZE: 20
steps: steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

View File

@@ -113,6 +113,10 @@ class MysqlConfig {
/** MySQL database user */ /** MySQL database user */
@Env('DB_MYSQLDB_USER') @Env('DB_MYSQLDB_USER')
user: string = 'root'; user: string = 'root';
/** MySQL connection pool size */
@Env('DB_MYSQLDB_POOL_SIZE')
poolSize: number = 10;
} }
@Config @Config

View File

@@ -69,6 +69,7 @@ describe('GlobalConfig', () => {
password: '', password: '',
port: 3306, port: 3306,
user: 'root', user: 'root',
poolSize: 10,
}, },
postgresdb: { postgresdb: {
database: 'n8n', database: 'n8n',

View File

@@ -157,6 +157,7 @@ describe('DbConnectionOptions', () => {
port: 3306, port: 3306,
user: 'root', user: 'root',
password: 'password', password: 'password',
poolSize: 10,
}; };
}); });
@@ -175,6 +176,7 @@ describe('DbConnectionOptions', () => {
password: 'password', password: 'password',
migrations: mysqlMigrations, migrations: mysqlMigrations,
timezone: 'Z', timezone: 'Z',
poolSize: 10,
}); });
}); });
@@ -193,6 +195,7 @@ describe('DbConnectionOptions', () => {
password: 'password', password: 'password',
migrations: mysqlMigrations, migrations: mysqlMigrations,
timezone: 'Z', timezone: 'Z',
poolSize: 10,
}); });
}); });
}); });

View File

@@ -135,10 +135,12 @@ export class DbConnectionOptions {
} }
private getMysqlConnectionOptions(dbType: 'mariadb' | 'mysqldb'): MysqlConnectionOptions { private getMysqlConnectionOptions(dbType: 'mariadb' | 'mysqldb'): MysqlConnectionOptions {
const { mysqldb: mysqlConfig } = this.config;
return { return {
type: dbType === 'mysqldb' ? 'mysql' : 'mariadb', type: dbType === 'mysqldb' ? 'mysql' : 'mariadb',
...this.getCommonOptions(), ...this.getCommonOptions(),
...this.getOverrides('mysqldb'), ...this.getOverrides('mysqldb'),
poolSize: mysqlConfig.poolSize,
migrations: mysqlMigrations, migrations: mysqlMigrations,
timezone: 'Z', // set UTC as default timezone: 'Z', // set UTC as default
}; };