badmfck-api-server 2.9.3 → 2.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,9 +20,9 @@ class MysqlAdapter {
20
20
  queries = [];
21
21
  static nextTransactionID = 1;
22
22
  transactions = [];
23
- maxTransactionWaitTime = 1000 * 60 * 1;
23
+ maxTransactionWaitTime = 1000 * 60 * 2;
24
24
  lastSuccessQueryTime = 0;
25
- pingInterval = 1000 * 60 * 2;
25
+ pingInterval = 1000 * 60 * 5;
26
26
  failReportFileStream = null;
27
27
  failReportFileStreamName = null;
28
28
  failReportLastAccessTime = 0;
@@ -79,8 +79,9 @@ class MysqlAdapter {
79
79
  if (Date.now() - this.lastSuccessQueryTime > this.pingInterval) {
80
80
  if (!this.pool)
81
81
  return;
82
- for (let i = 0; i < this.options.connectionLimit; i++)
82
+ for (let i = 0; i < this.options.connectionLimit; i++) {
83
83
  this.query({ query: "SELECT 1 @NOLIMIT" });
84
+ }
84
85
  }
85
86
  }, 1000 * 30);
86
87
  setInterval(() => {
@@ -210,6 +211,7 @@ class MysqlAdapter {
210
211
  if (this.options.debug)
211
212
  (0, LogService_1.logInfo)("Execute query:", query);
212
213
  const result = await conn.query(query);
214
+ this.lastSuccessQueryTime = +new Date();
213
215
  if (!request.transactionID)
214
216
  this.finalizeConnection(conn);
215
217
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "2.9.3",
3
+ "version": "2.9.4",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",