badmfck-api-server 2.2.8 → 2.2.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -83,7 +83,7 @@ async function Initializer(services) {
83
83
  exports.Initializer = Initializer;
84
84
  class APIService extends BaseService_1.BaseService {
85
85
  static nextLogID = 0;
86
- version = "2.2.8";
86
+ version = "2.2.9";
87
87
  options;
88
88
  monitor;
89
89
  monitorIndexFile;
@@ -206,7 +206,7 @@ class MysqlService extends BaseService_1.BaseService {
206
206
  };
207
207
  exports.REQ_MYSQL_TROLLBACK.listener = async (tid) => {
208
208
  const trx = this.transactions.find(i => i.id === tid);
209
- if (!trx)
209
+ if (!trx) {
210
210
  return {
211
211
  code: "NO_TRX",
212
212
  errno: 100004,
@@ -215,11 +215,13 @@ class MysqlService extends BaseService_1.BaseService {
215
215
  name: "NO_TRX",
216
216
  message: "Transaction not found"
217
217
  };
218
+ }
218
219
  this.transactions = this.transactions.filter(i => i.id !== tid);
219
220
  try {
220
221
  await trx.conn.rollback();
221
222
  trx.conn.removeAllListeners();
222
223
  trx.conn.release();
224
+ trx.conn.end();
223
225
  }
224
226
  catch (e) {
225
227
  (0, LogService_1.logError)("Can't rollback transaction");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "2.2.8",
3
+ "version": "2.2.9",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",