Add pm2 config to git

This commit is contained in:
2026-07-28 10:40:37 -04:00
parent 4e4a09ee3f
commit 2a8d9c473b
2 changed files with 205 additions and 1 deletions
+3 -1
View File
@@ -1232,7 +1232,9 @@ router.get('/search-products', async (req, res) => {
if (pid) {
const pids = String(pid).split(',').map(Number).filter(n => !isNaN(n) && n > 0);
if (pids.length === 0) {
connection.release();
// NOTE: do not release/end the connection here — getDbConnection() returns a
// single shared, cached mysql2 PromiseConnection (no .release()), not a pool
// connection. Closing it would break every other in-flight request.
return res.status(400).json({ error: 'Invalid pid parameter' });
}
if (pids.length === 1) {