Skip to content

Commit 3d5ae37

Browse files
authored
Merge pull request #1385 from input-output-hk/fix/LW-11028-slow-get-assets
LW-11028 Increase number of db connections in pool for asset provider
2 parents c8b9e38 + adcb643 commit 3d5ae37

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

nix/cardano-services/deployments/asset.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
TOKEN_METADATA_SERVER_URL = values.cardano-services.tokenMetadataServerUrl;
3333
USE_TYPEORM_ASSET_PROVIDER = "true";
3434

35-
POSTGRES_POOL_MAX_ASSET = "10";
35+
POSTGRES_POOL_MAX_ASSET = "500";
3636
POSTGRES_HOST_ASSET = values.postgresName;
3737
POSTGRES_PORT_ASSET = "5432";
3838
POSTGRES_DB_ASSET = "asset";

packages/cardano-services/src/Program/services/postgres.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export const getConnectionConfig = <Suffix extends ConnectionNames>(
115115
suffix: Suffix,
116116
options?: PosgresProgramOptions<Suffix>
117117
): Observable<PgConnectionConfig> => {
118+
const max = getPostgresOption(suffix, 'postgresPoolMax', options);
118119
const postgresConnectionString = getPostgresOption(suffix, 'postgresConnectionString', options);
119120
const postgresSslCaFile = getPostgresOption(suffix, 'postgresSslCaFile', options);
120121
const ssl = postgresSslCaFile ? { ca: loadSecret(postgresSslCaFile) } : undefined;
@@ -127,6 +128,7 @@ export const getConnectionConfig = <Suffix extends ConnectionNames>(
127128
return of({
128129
database: conn.database,
129130
host: conn.host,
131+
max,
130132
password: conn.password,
131133
port: conn.port ? Number.parseInt(conn.port) : undefined,
132134
ssl: mergeTlsOptions(conn, ssl),

0 commit comments

Comments
 (0)