increase connection pool
This commit is contained in:
@@ -61,6 +61,7 @@ export default defineConfig({
|
|||||||
emit: 'ts',
|
emit: 'ts',
|
||||||
},
|
},
|
||||||
connect: true,
|
connect: true,
|
||||||
|
// CLI-only (migrations/seeders run outside HTTP); runtime app config must not set this.
|
||||||
allowGlobalContext: true,
|
allowGlobalContext: true,
|
||||||
seeder: {
|
seeder: {
|
||||||
path: './dist/seeders',
|
path: './dist/seeders',
|
||||||
|
|||||||
@@ -8,15 +8,6 @@ import { MIKRO_ORM_QUERY_LOGGER } from '../common/constants';
|
|||||||
import { mikroOrmQueryLoggerProvider } from '../common/providers/mikro-orm-logger.provider';
|
import { mikroOrmQueryLoggerProvider } from '../common/providers/mikro-orm-logger.provider';
|
||||||
|
|
||||||
const dataBaseConfig: MikroOrmModuleAsyncOptions = {
|
const dataBaseConfig: MikroOrmModuleAsyncOptions = {
|
||||||
// entities: ['dist/**/*.entity.js'],
|
|
||||||
// entitiesTs: ['src/**/*.entity.ts'],
|
|
||||||
// dbName: 'your_db_name',
|
|
||||||
// type: 'postgresql',
|
|
||||||
// user: 'your_user',
|
|
||||||
// password: 'your_password',
|
|
||||||
// host: 'localhost',
|
|
||||||
// port: 5432,
|
|
||||||
// debug: true,
|
|
||||||
|
|
||||||
inject: [ConfigService, MIKRO_ORM_QUERY_LOGGER],
|
inject: [ConfigService, MIKRO_ORM_QUERY_LOGGER],
|
||||||
providers: [mikroOrmQueryLoggerProvider],
|
providers: [mikroOrmQueryLoggerProvider],
|
||||||
@@ -46,8 +37,8 @@ const dataBaseConfig: MikroOrmModuleAsyncOptions = {
|
|||||||
},
|
},
|
||||||
forceUtcTimezone: true,
|
forceUtcTimezone: true,
|
||||||
pool: {
|
pool: {
|
||||||
min: isProduction ? 5 : 2,
|
min: isProduction ? 30 : 5,
|
||||||
max: isProduction ? 20 : 10,
|
max: isProduction ? 100 : 50,
|
||||||
idleTimeoutMillis: 30000,
|
idleTimeoutMillis: 30000,
|
||||||
acquireTimeoutMillis: 30000,
|
acquireTimeoutMillis: 30000,
|
||||||
reapIntervalMillis: 1000,
|
reapIntervalMillis: 1000,
|
||||||
@@ -71,7 +62,7 @@ const dataBaseConfig: MikroOrmModuleAsyncOptions = {
|
|||||||
emit: 'ts',
|
emit: 'ts',
|
||||||
},
|
},
|
||||||
connect: true,
|
connect: true,
|
||||||
allowGlobalContext: true,
|
registerRequestContext: true,
|
||||||
driverOptions: {
|
driverOptions: {
|
||||||
connection: {
|
connection: {
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ export class ResponseInterceptor implements NestInterceptor {
|
|||||||
map(data => {
|
map(data => {
|
||||||
// If data is already wrapped or doesn't need wrapping, return as-is
|
// If data is already wrapped or doesn't need wrapping, return as-is
|
||||||
if (data && typeof data === 'object' && 'data' in data && 'success' in data) {
|
if (data && typeof data === 'object' && 'data' in data && 'success' in data) {
|
||||||
console.log('data', data)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
data: data,
|
data: data,
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ export class AdminRepository extends EntityRepository<Admin> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async findByPhoneAndRestaurantSlug(phone: string, slug: string): Promise<Admin | null> {
|
async findByPhoneAndRestaurantSlug(phone: string, slug: string): Promise<Admin | null> {
|
||||||
console.log('phone', phone);
|
const normalizedPhone = normalizePhone(phone);
|
||||||
const normalizedPhone = normalizePhone(phone);
|
|
||||||
// First, find the restaurant by slug using the same repository as auth service
|
// First, find the restaurant by slug using the same repository as auth service
|
||||||
const restaurant = await this.restRepository.findOne({ slug });
|
const restaurant = await this.restRepository.findOne({ slug });
|
||||||
if (!restaurant) {
|
if (!restaurant) {
|
||||||
|
|||||||
Reference in New Issue
Block a user