wsp-ms-core 1.0.97 → 1.0.98

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
@@ -1903,7 +1903,16 @@ var DefaultMysqlInboxProcessor = class {
1903
1903
  const records = await repository.listPending(20);
1904
1904
  for (let record of records) {
1905
1905
  if (this.handlers.has(record.topic)) {
1906
- await this.handlers.get(record.topic)(record);
1906
+ try {
1907
+ record.markProcessing();
1908
+ await repository.update(record);
1909
+ await this.handlers.get(record.topic)(record);
1910
+ record.markProcessed();
1911
+ } catch (error) {
1912
+ record.markWithError(error.toString());
1913
+ } finally {
1914
+ await repository.update(record);
1915
+ }
1907
1916
  }
1908
1917
  }
1909
1918
  });