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
env:
DB_MYSQLDB_PASSWORD: password
DB_MYSQLDB_POOL_SIZE: 20
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -86,6 +87,7 @@ jobs:
timeout-minutes: 20
env:
DB_MYSQLDB_PASSWORD: password
DB_MYSQLDB_POOL_SIZE: 20
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

View File

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

View File

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

View File

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

View File

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