wsp-ms-core 1.1.30 → 1.1.31

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.
package/dist/index.cjs CHANGED
@@ -2234,7 +2234,12 @@ var _MysqlConnector = class _MysqlConnector {
2234
2234
  }
2235
2235
  async getConnection() {
2236
2236
  console.log("[MysqlConnector] BEFORE pool.getConnection");
2237
- const conn = await this._pool.getConnection();
2237
+ const conn = await Promise.race([
2238
+ this._pool.getConnection(),
2239
+ new Promise(
2240
+ (_, reject) => setTimeout(() => reject(new Error("pool.getConnection timeout")), 1e4)
2241
+ )
2242
+ ]);
2238
2243
  console.log("[MysqlConnector] AFTER pool.getConnection");
2239
2244
  return this.wrap(conn);
2240
2245
  }
@@ -2449,10 +2454,16 @@ var DefaultMysqlInboxRunner = class {
2449
2454
  console.log("[InboxRunner] BEFORE getConnection");
2450
2455
  const connection = await this.databaseConnector.getConnection();
2451
2456
  console.log("[InboxRunner] AFTER getConnection");
2452
- const repository = new InboxMysqlRepository(connection);
2453
- console.log("[InboxRunner] BEFORE saveEvent");
2454
- await this.saveEvent(e, repository);
2455
- console.log("[InboxRunner] AFTER saveEvent");
2457
+ try {
2458
+ const repository = new InboxMysqlRepository(connection);
2459
+ console.log("[InboxRunner] BEFORE saveEvent");
2460
+ await this.saveEvent(e, repository);
2461
+ console.log("[InboxRunner] AFTER saveEvent");
2462
+ } finally {
2463
+ console.log("[InboxRunner] BEFORE connection.close");
2464
+ await connection.close();
2465
+ console.log("[InboxRunner] AFTER connection.close");
2466
+ }
2456
2467
  });
2457
2468
  } catch (error) {
2458
2469
  console.log(error.toString());