wsp-ms-core 1.0.96 → 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.cjs +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1888,6 +1888,7 @@ var DefaultMysqlInboxRunner = class {
|
|
|
1888
1888
|
var DefaultMysqlInboxProcessor = class {
|
|
1889
1889
|
constructor(uowFactory) {
|
|
1890
1890
|
this.uovFactory = uowFactory;
|
|
1891
|
+
this.handlers = /* @__PURE__ */ new Map();
|
|
1891
1892
|
}
|
|
1892
1893
|
async sleep() {
|
|
1893
1894
|
return new Promise((r) => setTimeout(r, 5e3));
|
|
@@ -1902,7 +1903,16 @@ var DefaultMysqlInboxProcessor = class {
|
|
|
1902
1903
|
const records = await repository.listPending(20);
|
|
1903
1904
|
for (let record of records) {
|
|
1904
1905
|
if (this.handlers.has(record.topic)) {
|
|
1905
|
-
|
|
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
|
+
}
|
|
1906
1916
|
}
|
|
1907
1917
|
}
|
|
1908
1918
|
});
|