.
This commit is contained in:
parent
9cd44c874f
commit
555c9284e2
3 changed files with 11 additions and 7 deletions
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue