fix: maintain connections pool (#8670)
This commit is contained in:
1 parent
eb0bfe9f33
commit
69830ca89c
4 files changed
+10
-2
No files matched your search
@@ -30,6 +30,9 @@ export function getMikroOrmConfig({
|
||||
entities: Object.values(mikroOrmEntities),
|
||||
schema: schema ?? process.env.MEDUSA_DB_SCHEMA,
|
||||
debug: false,
|
||||
pool: {
|
||||
min: 2,
|
||||
},
|
||||
migrations: {
|
||||
pathTs: pathToMigrations,
|
||||
silent: true,
|
||||
|
||||
@@ -93,6 +93,9 @@ export async function mikroOrmCreateConnection(
|
||||
schemaGenerator: {
|
||||
disableForeignKeys: false,
|
||||
},
|
||||
pool: database.pool as any,
|
||||
pool: {
|
||||
min: 2,
|
||||
...database.pool,
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -27,7 +27,7 @@ export function createPgConnection(options: Options) {
|
||||
pool: {
|
||||
// https://knexjs.org/guide/#pool
|
||||
...(pool ?? {}),
|
||||
min: (pool?.min as number) ?? 0,
|
||||
min: (pool?.min as number) ?? 2,
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user