@cadenza.io/service 1.9.50 → 1.9.52
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 +15 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -558,7 +558,7 @@ var ServiceRegistry = class _ServiceRegistry {
|
|
|
558
558
|
context.errored = true;
|
|
559
559
|
context.__error = "No active instances";
|
|
560
560
|
emit(
|
|
561
|
-
`meta.service_registry.load_balance_failed:${context.__deputyExecId}`,
|
|
561
|
+
`meta.service_registry.load_balance_failed:${context.__metadata.__deputyExecId}`,
|
|
562
562
|
context
|
|
563
563
|
);
|
|
564
564
|
return context;
|
|
@@ -1010,17 +1010,23 @@ var RestController = class _RestController {
|
|
|
1010
1010
|
try {
|
|
1011
1011
|
ctx2 = req.body;
|
|
1012
1012
|
deputyExecId = ctx2.__metadata.__deputyExecId;
|
|
1013
|
-
console.log("delegation", ctx2);
|
|
1013
|
+
console.log("delegation", deputyExecId, ctx2);
|
|
1014
1014
|
} catch (e) {
|
|
1015
1015
|
console.error("Error in delegation", e);
|
|
1016
|
-
res.send({
|
|
1016
|
+
res.send(__spreadValues({
|
|
1017
|
+
__status: "error",
|
|
1018
|
+
__error: e,
|
|
1019
|
+
errored: true
|
|
1020
|
+
}, ctx2));
|
|
1017
1021
|
return;
|
|
1018
1022
|
}
|
|
1019
1023
|
CadenzaService.createEphemeralMetaTask(
|
|
1020
1024
|
"Resolve delegation",
|
|
1021
1025
|
(endCtx) => {
|
|
1022
1026
|
console.log("Resolve delegation", endCtx);
|
|
1023
|
-
|
|
1027
|
+
const metadata = endCtx.__metadata;
|
|
1028
|
+
delete endCtx.__metadata;
|
|
1029
|
+
res.json(__spreadProps(__spreadValues(__spreadValues({}, endCtx), metadata), {
|
|
1024
1030
|
__status: "success"
|
|
1025
1031
|
}));
|
|
1026
1032
|
},
|
|
@@ -1211,6 +1217,7 @@ var RestController = class _RestController {
|
|
|
1211
1217
|
if (ctx2.__remoteRoutineName === void 0) {
|
|
1212
1218
|
return;
|
|
1213
1219
|
}
|
|
1220
|
+
console.log("Delegating", ctx2);
|
|
1214
1221
|
let resultContext;
|
|
1215
1222
|
try {
|
|
1216
1223
|
const response = yield (0, import_node_fetch.default)(`${URL}/delegation`, {
|
|
@@ -1227,7 +1234,10 @@ var RestController = class _RestController {
|
|
|
1227
1234
|
errored: true
|
|
1228
1235
|
}, ctx2), ctx2.__metadata);
|
|
1229
1236
|
} finally {
|
|
1230
|
-
emit2(
|
|
1237
|
+
emit2(
|
|
1238
|
+
`meta.fetch.delegated:${ctx2.__metadata.__deputyExecId}`,
|
|
1239
|
+
resultContext
|
|
1240
|
+
);
|
|
1231
1241
|
}
|
|
1232
1242
|
return resultContext;
|
|
1233
1243
|
}),
|