From 9cd44c874ffd8fe4405ef7b86029cd8612986eba Mon Sep 17 00:00:00 2001 From: Migan178 Date: Thu, 28 Sep 2023 13:19:43 +0900 Subject: [PATCH] . --- src/modules/database.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modules/database.ts b/src/modules/database.ts index 9782943..7666b37 100644 --- a/src/modules/database.ts +++ b/src/modules/database.ts @@ -17,4 +17,12 @@ export interface ResponseData extends BaseData { export { BaseData as NSFWData } -export default createPool(config.mysql) +const database = createPool(config.mysql) + +setInterval(async () => { + const db = await database.getConnection() + await db.ping() + db.release() +}, 60000) + +export default database