fix: add database pool options
This commit is contained in:
parent
07af1ca08d
commit
281c1b3f1d
@ -3,6 +3,7 @@ import dotenv from 'dotenv';
|
|||||||
import Api from '../../server/src';
|
import Api from '../../server/src';
|
||||||
import actions from '../../actions/src';
|
import actions from '../../actions/src';
|
||||||
import associated from '../../actions/src/middlewares/associated';
|
import associated from '../../actions/src/middlewares/associated';
|
||||||
|
import { DatabaseOptions } from '@nocobase/database';
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const sync = global.sync || {
|
const sync = global.sync || {
|
||||||
@ -28,6 +29,12 @@ const api = Api.create({
|
|||||||
charset: 'utf8mb4',
|
charset: 'utf8mb4',
|
||||||
collate: 'utf8mb4_unicode_ci',
|
collate: 'utf8mb4_unicode_ci',
|
||||||
},
|
},
|
||||||
|
pool: {
|
||||||
|
max: 5,
|
||||||
|
min: 0,
|
||||||
|
acquire: 30000,
|
||||||
|
idle: 10000,
|
||||||
|
},
|
||||||
logging: process.env.DB_LOG_SQL === 'on' ? console.log : false,
|
logging: process.env.DB_LOG_SQL === 'on' ? console.log : false,
|
||||||
define: {},
|
define: {},
|
||||||
sync,
|
sync,
|
||||||
|
Loading…
Reference in New Issue
Block a user