onu nasıl yapabilirim
private async connectMysql() {
const access: ConnectionOptions = {
host: process.env.HOST,
user: process.env.USER,
password: process.env.PASSWORD,
database: process.env.DATABASE,
multipleStatements: true,
connectionLimit: 10,
waitForConnections: true,
typeCast: function (field, next) {
if (field.type == "NEWDECIMAL") {
var value = field.string();
return value === null ? null : Number(value);
}
return next();
},
};
this.con = mysql.createPool(access);
} const pool = mysql.createPool({
host: 'localhost',
user: 'root',
database: 'test',
waitForConnections: true,
connectionLimit: 10,
maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit`
idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000
queueLimit: 0,
enableKeepAlive: true,
keepAliveInitialDelay: 0
});Hocam muhtemelen idleTimeout işinizi görecektir. Tabi emin değilim denemekte fayda var