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.cjs
CHANGED
|
@@ -1962,6 +1962,7 @@ var DefaultMysqlInboxRunner = class {
|
|
|
1962
1962
|
var DefaultMysqlInboxProcessor = class {
|
|
1963
1963
|
constructor(uowFactory) {
|
|
1964
1964
|
this.uovFactory = uowFactory;
|
|
1965
|
+
this.handlers = /* @__PURE__ */ new Map();
|
|
1965
1966
|
}
|
|
1966
1967
|
async sleep() {
|
|
1967
1968
|
return new Promise((r) => setTimeout(r, 5e3));
|
|
@@ -1976,7 +1977,16 @@ var DefaultMysqlInboxProcessor = class {
|
|
|
1976
1977
|
const records = await repository.listPending(20);
|
|
1977
1978
|
for (let record of records) {
|
|
1978
1979
|
if (this.handlers.has(record.topic)) {
|
|
1979
|
-
|
|
1980
|
+
try {
|
|
1981
|
+
record.markProcessing();
|
|
1982
|
+
await repository.update(record);
|
|
1983
|
+
await this.handlers.get(record.topic)(record);
|
|
1984
|
+
record.markProcessed();
|
|
1985
|
+
} catch (error) {
|
|
1986
|
+
record.markWithError(error.toString());
|
|
1987
|
+
} finally {
|
|
1988
|
+
await repository.update(record);
|
|
1989
|
+
}
|
|
1980
1990
|
}
|
|
1981
1991
|
}
|
|
1982
1992
|
});
|