fix: use pool instead of single conn for parallel queries

Single MySQL connection cannot handle concurrent prepared statements
via Promise.all — causes protocol conflicts and JSON parse errors.
Switch all bi.queries.js functions to use pool.execute() (each query
gets its own connection from pool). Bump connectionLimit 10→20.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-02-16 23:09:00 -05:00
parent ab7a886836
commit 42803bd946
2 changed files with 45 additions and 60 deletions

View File

@@ -9,7 +9,7 @@ const pool = mysql.createPool({
password: process.env.PW_MYSQL,
database: 'cambio_db',
waitForConnections: true,
connectionLimit: 10,
connectionLimit: 20,
});
module.exports = pool;