Fixed a bunch of MySQL pooling issues where connections were not properly released or were double-released
This commit is contained in:
parent
06d2712916
commit
0392473ecd
8 changed files with 10 additions and 13 deletions
|
@ -21,7 +21,6 @@ module.exports.list = (start, limit, callback) => {
|
|||
connection.query('SELECT FOUND_ROWS() AS total', (err, total) => {
|
||||
connection.release();
|
||||
if (err) {
|
||||
connection.release();
|
||||
return callback(err);
|
||||
}
|
||||
return callback(null, rows, total && total[0] && total[0].total);
|
||||
|
@ -45,8 +44,8 @@ module.exports.quicklist = callback => {
|
|||
let lists = (rows || []).map(tools.convertKeys);
|
||||
|
||||
connection.query('SELECT id, list, name FROM segments ORDER BY list, name LIMIT 1000', (err, rows) => {
|
||||
connection.release();
|
||||
if (err) {
|
||||
connection.release();
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
|
@ -56,7 +55,6 @@ module.exports.quicklist = callback => {
|
|||
list.segments = segments.filter(segment => segment.list === list.id);
|
||||
});
|
||||
|
||||
connection.release();
|
||||
return callback(null, lists);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue