WanteD Posted November 18, 2020 Posted November 18, 2020 Hello! Forgive me if I wrote in the wrong place. Faced a problem: Quite a long time answer when dealing with mysql2 pools. At the same time, if I work through createConnection, everything is fine, the answer is quick. What could be? The answer to such a request comes after 3 seconds . Or if I work without pools, then I get the answer in the same second. // Connect mp.db = await require("mysql2").createPool({ connectionLimit: config.connectionLimit, host: config.host, user: config.user, password: config.password, database: config.database }); // Query mp.db.query(`SELECT * FROM test WHERE username = '${player.name}'`, function (error, result, fields) { if (error) return mp.dbError('authPlayer', error, authPlayer(player)); if (result.length > 0) { player.call(`createWindow`, ['auth']); return true; } player.call(`createWindow`, ['register']); });
WanteD Posted November 19, 2020 Author Posted November 19, 2020 I have been suffering for a week. Guys, who knows what the problem is?
WanteD Posted November 30, 2020 Author Posted November 30, 2020 The problem was with the Ubuntu version. Found the reason by chance. The server was started on 16.04 - there was a problem. Updated to 18.04 - the problem remains. But with Ubuntu 20.04, the problem disappeared.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now