diff --git a/backend/src/entities/connection/connection.controller.ts b/backend/src/entities/connection/connection.controller.ts index db99885fa..68badb4df 100644 --- a/backend/src/entities/connection/connection.controller.ts +++ b/backend/src/entities/connection/connection.controller.ts @@ -737,6 +737,7 @@ export class ConnectionController { type: ConnectionDiagramResponseDTO, }) @UseGuards(ConnectionDiagramGuard) + @Timeout(90000) @Get('/connection/diagram/:connectionId') async getConnectionDiagram( @SlugUuid('connectionId') connectionId: string, diff --git a/backend/src/entities/table-schema/table-schema.controller.ts b/backend/src/entities/table-schema/table-schema.controller.ts index 891f1b142..38a59d895 100644 --- a/backend/src/entities/table-schema/table-schema.controller.ts +++ b/backend/src/entities/table-schema/table-schema.controller.ts @@ -41,6 +41,7 @@ import { } from './use-cases/table-schema-use-cases.interface.js'; @UseInterceptors(SentryInterceptor) +@Timeout(90000) @Controller() @ApiBearerAuth() @ApiTags('Table Schema Changes') diff --git a/shared-code/src/knex-manager/knex-manager.ts b/shared-code/src/knex-manager/knex-manager.ts index c8c2ba8ea..12d9f4398 100644 --- a/shared-code/src/knex-manager/knex-manager.ts +++ b/shared-code/src/knex-manager/knex-manager.ts @@ -1,8 +1,8 @@ -import knex, { Knex } from 'knex'; import getPort from 'get-port'; +import knex, { Knex } from 'knex'; +import { LRUStorage } from '../caching/lru-storage.js'; import { ConnectionParams } from '../data-access-layer/shared/data-structures/connections-params.ds.js'; import { getTunnel } from '../helpers/get-ssh-tunnel.js'; -import { LRUStorage } from '../caching/lru-storage.js'; export class KnexManager { static knexStorage() { const knexMap = new Map Promise>>(); @@ -126,6 +126,7 @@ export class KnexManager { private static getPostgresKnex(connection: ConnectionParams): Knex { const { host, username, password, database, port, type, cert, ssl } = connection; + const pool = { min: 0, max: 3 }; if (process.env.NODE_ENV === 'test') { const newKnex = knex({ client: type, @@ -137,6 +138,7 @@ export class KnexManager { port: port, application_name: 'rocketadmin', }, + pool, }); return newKnex; } @@ -155,6 +157,7 @@ export class KnexManager { rejectUnauthorized: false, }, }, + pool, }); return newKnex; } @@ -169,6 +172,7 @@ export class KnexManager { application_name: 'rocketadmin', ssl: ssl ? { ca: cert ?? undefined, rejectUnauthorized: !cert } : false, }, + pool, }); return newKnex; }