与底座的连接未关闭

问题描述

我正在使用 MysqL2 来处理数据库。 当处理从消息中移除反应的触发器时,连接并没有关闭,而是传递了 .end () 命令,但什么都不做

const MysqL = require('MysqL2');
const MysqL_cfg = require('../MysqL_cfg.json');

module.exports.run = async (messageReaction,user) => {

  try {

    var con = MysqL.createPool(MysqL_cfg).promise();

  if (user.bot != true) {

    if (messageReaction._emoji.id === '812934232799969361' && messageReaction.message.author.id === '789484089736429589' && messageReaction.message.embeds[0].author.name === 'Destiny 2') {   
      
      if (messageReaction.message.embeds[0].fields[0].value.search(user.id) >= 0) { 
        
      } else {

      let a = messageReaction.users.cache.filter(val => val.bot === false)
      let b = a.map(v => v.id)
      let sbor_notification = ""

      await con.execute(`UPDATE events SET users = '${b}',json_users = '${sbor_notification}' WHERE id = '${messageReaction.message.id}'`);

    messageReaction.message.edit("@here"); 
    } 
    }
  }
con.end();
} catch (error) {
  console.error(error);
}
};

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)