File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ const getPrismaConnectConfig = (): mariadb.PoolConfig => ({
5050 password : process . env . DATABASE_PASSWORD ,
5151 database : process . env . DATABASE_NAME ,
5252 connectionLimit : 40 ,
53+ idleTimeout : 600 ,
54+ minDelayValidation : 10000 ,
5355} )
5456
5557const getRedisConfig = ( ) => ( {
Original file line number Diff line number Diff line change @@ -5,9 +5,6 @@ import * as mariadb from 'mariadb'
55
66@Injectable ( )
77export class PrismaService extends PrismaClient implements OnModuleInit {
8-
9- private readonly dbPool : any ;
10-
118 constructor ( @Inject ( 'ORM_OPTIONS' ) ormOption : mariadb . PoolConfig ) {
129 const adapter = new PrismaMariaDb ( ormOption )
1310 super ( {
@@ -32,8 +29,6 @@ export class PrismaService extends PrismaClient implements OnModuleInit {
3229 ] ,
3330 errorFormat : 'pretty' ,
3431 } )
35-
36- this . dbPool = ormOption ;
3732 }
3833
3934 async onModuleInit ( ) {
@@ -52,10 +47,5 @@ export class PrismaService extends PrismaClient implements OnModuleInit {
5247 async onModuleDestroy ( ) {
5348 console . log ( 'Closing Prisma connection...' ) ;
5449 await this . $disconnect ( ) ;
55-
56- if ( this . dbPool && typeof this . dbPool . end === 'function' ) {
57- await this . dbPool . end ( ) ;
58- console . log ( 'MariaDB Pool closed successfully' ) ;
59- }
6050 }
6151}
You can’t perform that action at this time.
0 commit comments