Skip to content

Commit c39ed66

Browse files
Merge pull request #357 from sparcs-kaist/hotfix
Hotfix
2 parents 10999be + 4bbd234 commit c39ed66

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

apps/server/src/settings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

5557
const getRedisConfig = () => ({

libs/prisma-client/src/prisma.service.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import * as mariadb from 'mariadb'
55

66
@Injectable()
77
export 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
}

0 commit comments

Comments
 (0)