wsp-ms-core 1.0.97 → 1.0.99

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.js CHANGED
@@ -1295,6 +1295,7 @@ var InboxRecord = class _InboxRecord {
1295
1295
  }
1296
1296
  markProcessed() {
1297
1297
  this._status = ProcessStatus.PROCESSED;
1298
+ this._errorMessage = "";
1298
1299
  this._processedAt = DateTime.now();
1299
1300
  }
1300
1301
  markProcessing() {
@@ -1903,7 +1904,16 @@ var DefaultMysqlInboxProcessor = class {
1903
1904
  const records = await repository.listPending(20);
1904
1905
  for (let record of records) {
1905
1906
  if (this.handlers.has(record.topic)) {
1906
- await this.handlers.get(record.topic)(record);
1907
+ try {
1908
+ record.markProcessing();
1909
+ await repository.update(record);
1910
+ await this.handlers.get(record.topic)(record);
1911
+ record.markProcessed();
1912
+ } catch (error) {
1913
+ record.markWithError(error.toString());
1914
+ } finally {
1915
+ await repository.update(record);
1916
+ }
1907
1917
  }
1908
1918
  }
1909
1919
  });