Add pm2 config to git
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user