@cadenza.io/service 2.3.10 → 2.3.12
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 +16 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1717,20 +1717,11 @@ var SocketController = class _SocketController {
|
|
|
1717
1717
|
CadenzaService.log("Socket setup error: No server", {}, "error");
|
|
1718
1718
|
return { ...ctx, __error: "No server", errored: true };
|
|
1719
1719
|
}
|
|
1720
|
-
const handshakeMap = {};
|
|
1721
1720
|
server.on("connection", (ws) => {
|
|
1722
1721
|
try {
|
|
1723
1722
|
ws.on(
|
|
1724
1723
|
"handshake",
|
|
1725
1724
|
(ctx2, callback) => {
|
|
1726
|
-
if (handshakeMap[ctx2.serviceInstanceId]) {
|
|
1727
|
-
callback({
|
|
1728
|
-
status: "error",
|
|
1729
|
-
error: "Duplicate handshake"
|
|
1730
|
-
});
|
|
1731
|
-
return;
|
|
1732
|
-
}
|
|
1733
|
-
handshakeMap[ctx2.serviceInstanceId] = true;
|
|
1734
1725
|
CadenzaService.log("SocketServer: New connection", {
|
|
1735
1726
|
...ctx2,
|
|
1736
1727
|
socketId: ws.id
|
|
@@ -1766,6 +1757,10 @@ var SocketController = class _SocketController {
|
|
|
1766
1757
|
"delegation",
|
|
1767
1758
|
(ctx2, callback) => {
|
|
1768
1759
|
const deputyExecId = ctx2.__metadata.__deputyExecId;
|
|
1760
|
+
console.log(
|
|
1761
|
+
"Delegation request received:",
|
|
1762
|
+
ctx2.__localTaskName
|
|
1763
|
+
);
|
|
1769
1764
|
CadenzaService.createEphemeralMetaTask(
|
|
1770
1765
|
"Resolve delegation",
|
|
1771
1766
|
(ctx3) => {
|
|
@@ -1800,6 +1795,7 @@ var SocketController = class _SocketController {
|
|
|
1800
1795
|
"signal",
|
|
1801
1796
|
(ctx2, callback) => {
|
|
1802
1797
|
if (CadenzaService.signalBroker.listObservedSignals().includes(ctx2.__signalName)) {
|
|
1798
|
+
console.log("Signal received:", ctx2.__signalName);
|
|
1803
1799
|
callback({
|
|
1804
1800
|
__status: "success",
|
|
1805
1801
|
__signalName: ctx2.__signalName
|
|
@@ -1960,7 +1956,6 @@ var SocketController = class _SocketController {
|
|
|
1960
1956
|
};
|
|
1961
1957
|
socket.on("connect", () => {
|
|
1962
1958
|
if (handshake) return;
|
|
1963
|
-
console.log("socket connected");
|
|
1964
1959
|
CadenzaService.emit(`meta.socket_client.connected:${fetchId}`, ctx);
|
|
1965
1960
|
});
|
|
1966
1961
|
socket.on("delegation_progress", (ctx2) => {
|
|
@@ -2043,7 +2038,7 @@ var SocketController = class _SocketController {
|
|
|
2043
2038
|
1e4,
|
|
2044
2039
|
(result) => {
|
|
2045
2040
|
if (result.status === "success") {
|
|
2046
|
-
CadenzaService.log("Socket connected", {
|
|
2041
|
+
CadenzaService.log("Socket client connected", {
|
|
2047
2042
|
result,
|
|
2048
2043
|
serviceName,
|
|
2049
2044
|
socketId: socket?.id,
|
|
@@ -2079,6 +2074,7 @@ var SocketController = class _SocketController {
|
|
|
2079
2074
|
delete ctx2.__broadcast;
|
|
2080
2075
|
const requestSentAt = Date.now();
|
|
2081
2076
|
pendingDelegationIds.add(ctx2.__metadata.__deputyExecId);
|
|
2077
|
+
console.log("Delegating task:", ctx2.__remoteRoutineName);
|
|
2082
2078
|
emitWhenReady?.(
|
|
2083
2079
|
"delegation",
|
|
2084
2080
|
ctx2,
|
|
@@ -2087,6 +2083,12 @@ var SocketController = class _SocketController {
|
|
|
2087
2083
|
const requestDuration = Date.now() - requestSentAt;
|
|
2088
2084
|
const metadata = resultContext.__metadata;
|
|
2089
2085
|
delete resultContext.__metadata;
|
|
2086
|
+
console.log(
|
|
2087
|
+
"Delegation response received:",
|
|
2088
|
+
ctx2.__remoteRoutineName,
|
|
2089
|
+
"Duration:",
|
|
2090
|
+
requestDuration
|
|
2091
|
+
);
|
|
2090
2092
|
emit(
|
|
2091
2093
|
`meta.socket_client.delegated:${ctx2.__metadata.__deputyExecId}`,
|
|
2092
2094
|
{
|
|
@@ -2121,6 +2123,7 @@ var SocketController = class _SocketController {
|
|
|
2121
2123
|
}
|
|
2122
2124
|
return new Promise((resolve) => {
|
|
2123
2125
|
delete ctx2.__broadcast;
|
|
2126
|
+
console.log("Transmitting signal:", ctx2.__signalName);
|
|
2124
2127
|
emitWhenReady?.("signal", ctx2, 5e3, (response) => {
|
|
2125
2128
|
if (ctx2.__routineExecId) {
|
|
2126
2129
|
emit(
|
|
@@ -4196,8 +4199,9 @@ var GraphSyncController = class _GraphSyncController {
|
|
|
4196
4199
|
{ __syncing: true },
|
|
4197
4200
|
18e4
|
|
4198
4201
|
);
|
|
4199
|
-
CadenzaService.schedule("meta.sync_requested", { __syncing: true },
|
|
4202
|
+
CadenzaService.schedule("meta.sync_requested", { __syncing: true }, 5e3);
|
|
4200
4203
|
}
|
|
4204
|
+
console.log("Syncing initiated", this.isCadenzaDBReady);
|
|
4201
4205
|
}
|
|
4202
4206
|
};
|
|
4203
4207
|
|