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
|
@ -328,11 +328,11 @@ function addCustomField(listId, name, defaultValue, type, group, visible, callba
|
|||
}
|
||||
|
||||
connection.query(query, err => {
|
||||
connection.release();
|
||||
if (err) {
|
||||
connection.query('DELETE FROM custom_fields WHERE id=? LIMIT 1', [fieldId], () => false);
|
||||
connection.query('DELETE FROM custom_fields WHERE id=? LIMIT 1', [fieldId], () => connection.release());
|
||||
return callback(err);
|
||||
}
|
||||
connection.release();
|
||||
return callback(null, fieldId);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue