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.cjs CHANGED
@@ -1369,6 +1369,7 @@ var InboxRecord = class _InboxRecord {
1369
1369
  }
1370
1370
  markProcessed() {
1371
1371
  this._status = ProcessStatus.PROCESSED;
1372
+ this._errorMessage = "";
1372
1373
  this._processedAt = DateTime.now();
1373
1374
  }
1374
1375
  markProcessing() {
@@ -1977,7 +1978,16 @@ var DefaultMysqlInboxProcessor = class {
1977
1978
  const records = await repository.listPending(20);
1978
1979
  for (let record of records) {
1979
1980
  if (this.handlers.has(record.topic)) {
1980
- await this.handlers.get(record.topic)(record);
1981
+ try {
1982
+ record.markProcessing();
1983
+ await repository.update(record);
1984
+ await this.handlers.get(record.topic)(record);
1985
+ record.markProcessed();
1986
+ } catch (error) {
1987
+ record.markWithError(error.toString());
1988
+ } finally {
1989
+ await repository.update(record);
1990
+ }
1981
1991
  }
1982
1992
  }
1983
1993
  });