.
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)
|
if (NODE_ENV === 'development') this.on('debug', console.info)
|
||||||
this.chatBot.train(this)
|
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 => {
|
readdirSync(join(__dirname, 'Commands')).forEach(file => {
|
||||||
const a = require(join(__dirname, 'Commands', file))
|
const a = require(join(__dirname, 'Commands', file))
|
||||||
const b: Command = new a.default()
|
const b: Command = new a.default()
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default class extends Command {
|
||||||
else return
|
else return
|
||||||
})
|
})
|
||||||
msg.channel.send(
|
msg.channel.send(
|
||||||
`머핀 데이터: ${muffin.length}개\nnsfw 데이터: ${nsfw.length}개`
|
`머핀 데이터: ${muffin.length}개\nnsfw 데이터: ${nsfw.length}개`,
|
||||||
)
|
)
|
||||||
db.release()
|
db.release()
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,10 +19,4 @@ export { BaseData as NSFWData }
|
||||||
|
|
||||||
const database = createPool(config.mysql)
|
const database = createPool(config.mysql)
|
||||||
|
|
||||||
setInterval(async () => {
|
|
||||||
const db = await database.getConnection()
|
|
||||||
await db.ping()
|
|
||||||
db.release()
|
|
||||||
}, 60000)
|
|
||||||
|
|
||||||
export default database
|
export default database
|
||||||
|
|
Loading…
Reference in a new issue