Browse Source

Merge pull request #3944 from finn-auto/issue-3767-400-on-fargate

set min max for knex pool
pull/3975/head
navi 2 years ago committed by GitHub
parent
commit
c18d087318
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      packages/nocodb/src/lib/utils/NcConfigFactory.ts
  2. 6
      packages/nocodb/src/lib/utils/common/NcConnectionMgrv2.ts

10
packages/nocodb/src/lib/utils/NcConfigFactory.ts

@ -41,6 +41,14 @@ const defaultConnectionConfig: any = {
dateStrings: true,
};
// default knex options
const defaultConnectionOptions = {
pool: {
min: 0,
max: 10
}
};
const knownQueryParams = [
{
parameter: 'database',
@ -733,7 +741,7 @@ export default class NcConfigFactory implements NcConfig {
// }
}
export { defaultConnectionConfig };
export { defaultConnectionConfig, defaultConnectionOptions };
/**
* @copyright Copyright (c) 2021, Xgene Cloud Ltd

6
packages/nocodb/src/lib/utils/common/NcConnectionMgrv2.ts

@ -5,7 +5,10 @@ import { XKnex } from '../../db/sql-data-mapper';
// import Knex from 'knex';
// import NcMetaIO from '../meta/NcMetaIO';
import { defaultConnectionConfig } from '../NcConfigFactory';
import {
defaultConnectionConfig,
defaultConnectionOptions
} from '../NcConfigFactory';
import Base from '../../models/Base';
import Noco from '../../Noco';
@ -99,6 +102,7 @@ export default class NcConnectionMgrv2 {
// ? (connectionConfig.connection as Knex.Config)
// :
{
...defaultConnectionOptions,
...connectionConfig,
connection: {
...defaultConnectionConfig,

Loading…
Cancel
Save