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