From 281c1b3f1ddc9d8663b7785a78827fd52acd725f Mon Sep 17 00:00:00 2001 From: chenos Date: Fri, 26 Mar 2021 10:06:36 +0800 Subject: [PATCH] fix: add database pool options --- packages/api/src/app.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/api/src/app.ts b/packages/api/src/app.ts index e6885764b..1c792dd00 100644 --- a/packages/api/src/app.ts +++ b/packages/api/src/app.ts @@ -3,6 +3,7 @@ import dotenv from 'dotenv'; import Api from '../../server/src'; import actions from '../../actions/src'; import associated from '../../actions/src/middlewares/associated'; +import { DatabaseOptions } from '@nocobase/database'; // @ts-ignore const sync = global.sync || { @@ -28,6 +29,12 @@ const api = Api.create({ charset: 'utf8mb4', collate: 'utf8mb4_unicode_ci', }, + pool: { + max: 5, + min: 0, + acquire: 30000, + idle: 10000, + }, logging: process.env.DB_LOG_SQL === 'on' ? console.log : false, define: {}, sync,