If i activate a screen on my debian server with my express js api it will crash after a few hours with this error:
Error: read ECONNRESET
File "internal/stream_base_commons.js", line 209, col 20, in TCP.onStreamRead
File "internal/async_hooks.js", line 130, col 17, in TCP.callbackTrampoline
I created a pool in my Express JS application but it crashes, when I start my Debian screen with the Express JS application it crashes after a few hours if I don't use the API.
Please help me, I don't know how to fix, I think it's the firewall but I don't know. It can also be a configuration on my mysql.
const pool = mysql.createPool({
host: 'localhost',
user: 'user',
database: 'database',
password: 'password',
connectionLimit: 10,
});
I added on every mysql request this code:
pool.getConnection((err, connection) => {
if (err) {
console.log(err);
return res.status(400).send({
msg: err
});
}
and on the end
connection.release();