Skip to content

Commit 3616f21

Browse files
authored
Merge pull request #262 from Canner/fix/canner-profile-connection-max
Fix: assign canner driver connection pool by env
2 parents 6c71a0e + 6321196 commit 3616f21

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/extension-store-canner/src/lib/canner/profileReader.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class CannerProfileReader extends ProfileReader {
4343
);
4444

4545
// generate profiles from the indicator files of each workspaces
46-
const { user, password, host, port } = this.envConfig.profile;
46+
const { user, password, host, port, max } = this.envConfig.profile;
4747
if (!user || !password || !host)
4848
throw new ConfigurationError(
4949
'Canner profile reader needs username, password, host properties.'
@@ -64,6 +64,7 @@ export class CannerProfileReader extends ProfileReader {
6464
host,
6565
port,
6666
database: workspaceSqlName,
67+
max,
6768
},
6869
allow: '*',
6970
} as Profile<Record<string, any>>;

packages/extension-store-canner/src/lib/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface CannerDriverProfileOptions {
1111
host?: string;
1212
// port to connect to canner enterprise. Default is 7432
1313
port?: number;
14+
max?: number;
1415
}
1516

1617
export interface StorageServiceOptions {
@@ -60,6 +61,8 @@ export const getEnvConfig = (): CannerStoreConfig => {
6061
host: process.env['PROFILE_CANNER_DRIVER_HOST'],
6162
// port 7432 is the PG Wire Protocol port, which is the default port for connecting canner enterprise driver
6263
port: Number(process.env['PROFILE_CANNER_DRIVER_PORT']) || 7432,
64+
max:
65+
Number(process.env['PROFILE_CANNER_DRIVER_CONNECTION_POOL_MAX']) || 10,
6366
},
6467
storage: {
6568
provider: process.env['STORAGE_PROVIDER'],

0 commit comments

Comments
 (0)