wsp-ms-core 1.1.21 → 1.1.23
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 +10 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2127,6 +2127,7 @@ var DefaultMysqlInboxRunner = class {
|
|
|
2127
2127
|
console.log(data);
|
|
2128
2128
|
});
|
|
2129
2129
|
this.eventManager.onMessage((data) => {
|
|
2130
|
+
console.log(JSON.stringify(data));
|
|
2130
2131
|
});
|
|
2131
2132
|
this.eventManager.onError((data) => {
|
|
2132
2133
|
console.log(data);
|
|
@@ -2150,9 +2151,10 @@ var DefaultMysqlInboxRunner = class {
|
|
|
2150
2151
|
|
|
2151
2152
|
// src/infrastructure/runners/default-mysql-inbox-processor.ts
|
|
2152
2153
|
var DefaultMysqlInboxProcessor = class {
|
|
2153
|
-
constructor(uowFactory) {
|
|
2154
|
+
constructor(uowFactory, onError) {
|
|
2154
2155
|
this.uovFactory = uowFactory;
|
|
2155
2156
|
this.handlers = /* @__PURE__ */ new Map();
|
|
2157
|
+
this.onError = onError;
|
|
2156
2158
|
}
|
|
2157
2159
|
async sleep() {
|
|
2158
2160
|
return new Promise((r) => setTimeout(r, 5e3));
|
|
@@ -2174,6 +2176,13 @@ var DefaultMysqlInboxProcessor = class {
|
|
|
2174
2176
|
record.markProcessed();
|
|
2175
2177
|
} catch (error) {
|
|
2176
2178
|
record.markWithError(error.toString());
|
|
2179
|
+
if (this.onError) {
|
|
2180
|
+
try {
|
|
2181
|
+
this.onError(record, error);
|
|
2182
|
+
} catch (handlerError) {
|
|
2183
|
+
console.error("Error dentro del onError handler:", handlerError);
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2177
2186
|
} finally {
|
|
2178
2187
|
await repository.update(record);
|
|
2179
2188
|
}
|