This commit is contained in:
Siwoo Jeon 2023-10-04 21:35:14 +09:00
parent 9cd44c874f
commit 555c9284e2
Signed by: migan
GPG key ID: C4151385FFD2082A
3 changed files with 11 additions and 7 deletions

View file

@ -33,6 +33,16 @@ export default class MuffinAI extends Client {
if (NODE_ENV === 'development') this.on('debug', console.info)
this.chatBot.train(this)
setInterval(async () => {
const db = await this.chatBot.db.getConnection()
await db.beginTransaction()
await db.ping()
await db.commit()
db.release()
}, 600000)
readdirSync(join(__dirname, 'Commands')).forEach(file => {
const a = require(join(__dirname, 'Commands', file))
const b: Command = new a.default()

View file

@ -15,7 +15,7 @@ export default class extends Command {
else return
})
msg.channel.send(
`머핀 데이터: ${muffin.length}\nnsfw 데이터: ${nsfw.length}`
`머핀 데이터: ${muffin.length}\nnsfw 데이터: ${nsfw.length}`,
)
db.release()
}

View file

@ -19,10 +19,4 @@ export { BaseData as NSFWData }
const database = createPool(config.mysql)
setInterval(async () => {
const db = await database.getConnection()
await db.ping()
db.release()
}, 60000)
export default database