wsp-ms-core 1.1.27 → 1.1.28

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);
@@ -2393,7 +2393,13 @@ var DefaultMysqlInboxRunner = class {
2393
2393
  for (let topic of this.topics) {
2394
2394
  try {
2395
2395
  this.eventManager.route(topic, async (e) => {
2396
- await this.saveEvent(e, new InboxMysqlRepository(await this.databaseConnector.getConnection()));
2396
+ console.log("[InboxRunner] BEFORE getConnection");
2397
+ const connection = await this.databaseConnector.getConnection();
2398
+ console.log("[InboxRunner] AFTER getConnection");
2399
+ const repository = new InboxMysqlRepository(connection);
2400
+ console.log("[InboxRunner] BEFORE saveEvent");
2401
+ await this.saveEvent(e, repository);
2402
+ console.log("[InboxRunner] AFTER saveEvent");
2397
2403
  });
2398
2404
  } catch (error) {
2399
2405
  console.log(error.toString());