wsp-ms-core 1.1.27 → 1.1.29

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
@@ -1263,9 +1263,9 @@ var _EventBus = class _EventBus {
1263
1263
  await this.repository.create(mapper(event));
1264
1264
  }
1265
1265
  async publishMany(events) {
1266
- for (let event of events) {
1267
- await this.publish(event);
1268
- }
1266
+ await Promise.all(
1267
+ events.map((event) => this.publish(event))
1268
+ );
1269
1269
  }
1270
1270
  static addMapper(eventType, mapper) {
1271
1271
  _EventBus.MAPPERS.set(eventType, mapper);
@@ -2185,7 +2185,9 @@ var _MysqlConnector = class _MysqlConnector {
2185
2185
  return rows;
2186
2186
  }
2187
2187
  async getConnection() {
2188
+ console.log("[MysqlConnector] BEFORE pool.getConnection");
2188
2189
  const conn = await this._pool.getConnection();
2190
+ console.log("[MysqlConnector] AFTER pool.getConnection");
2189
2191
  return this.wrap(conn);
2190
2192
  }
2191
2193
  async closePool() {
@@ -2393,7 +2395,13 @@ var DefaultMysqlInboxRunner = class {
2393
2395
  for (let topic of this.topics) {
2394
2396
  try {
2395
2397
  this.eventManager.route(topic, async (e) => {
2396
- await this.saveEvent(e, new InboxMysqlRepository(await this.databaseConnector.getConnection()));
2398
+ console.log("[InboxRunner] BEFORE getConnection");
2399
+ const connection = await this.databaseConnector.getConnection();
2400
+ console.log("[InboxRunner] AFTER getConnection");
2401
+ const repository = new InboxMysqlRepository(connection);
2402
+ console.log("[InboxRunner] BEFORE saveEvent");
2403
+ await this.saveEvent(e, repository);
2404
+ console.log("[InboxRunner] AFTER saveEvent");
2397
2405
  });
2398
2406
  } catch (error) {
2399
2407
  console.log(error.toString());