@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.js
CHANGED
|
@@ -1765,20 +1765,11 @@ var SocketController = class _SocketController {
|
|
|
1765
1765
|
CadenzaService.log("Socket setup error: No server", {}, "error");
|
|
1766
1766
|
return { ...ctx, __error: "No server", errored: true };
|
|
1767
1767
|
}
|
|
1768
|
-
const handshakeMap = {};
|
|
1769
1768
|
server.on("connection", (ws) => {
|
|
1770
1769
|
try {
|
|
1771
1770
|
ws.on(
|
|
1772
1771
|
"handshake",
|
|
1773
1772
|
(ctx2, callback) => {
|
|
1774
|
-
if (handshakeMap[ctx2.serviceInstanceId]) {
|
|
1775
|
-
callback({
|
|
1776
|
-
status: "error",
|
|
1777
|
-
error: "Duplicate handshake"
|
|
1778
|
-
});
|
|
1779
|
-
return;
|
|
1780
|
-
}
|
|
1781
|
-
handshakeMap[ctx2.serviceInstanceId] = true;
|
|
1782
1773
|
CadenzaService.log("SocketServer: New connection", {
|
|
1783
1774
|
...ctx2,
|
|
1784
1775
|
socketId: ws.id
|
|
@@ -1814,6 +1805,10 @@ var SocketController = class _SocketController {
|
|
|
1814
1805
|
"delegation",
|
|
1815
1806
|
(ctx2, callback) => {
|
|
1816
1807
|
const deputyExecId = ctx2.__metadata.__deputyExecId;
|
|
1808
|
+
console.log(
|
|
1809
|
+
"Delegation request received:",
|
|
1810
|
+
ctx2.__localTaskName
|
|
1811
|
+
);
|
|
1817
1812
|
CadenzaService.createEphemeralMetaTask(
|
|
1818
1813
|
"Resolve delegation",
|
|
1819
1814
|
(ctx3) => {
|
|
@@ -1848,6 +1843,7 @@ var SocketController = class _SocketController {
|
|
|
1848
1843
|
"signal",
|
|
1849
1844
|
(ctx2, callback) => {
|
|
1850
1845
|
if (CadenzaService.signalBroker.listObservedSignals().includes(ctx2.__signalName)) {
|
|
1846
|
+
console.log("Signal received:", ctx2.__signalName);
|
|
1851
1847
|
callback({
|
|
1852
1848
|
__status: "success",
|
|
1853
1849
|
__signalName: ctx2.__signalName
|
|
@@ -2008,7 +2004,6 @@ var SocketController = class _SocketController {
|
|
|
2008
2004
|
};
|
|
2009
2005
|
socket.on("connect", () => {
|
|
2010
2006
|
if (handshake) return;
|
|
2011
|
-
console.log("socket connected");
|
|
2012
2007
|
CadenzaService.emit(`meta.socket_client.connected:${fetchId}`, ctx);
|
|
2013
2008
|
});
|
|
2014
2009
|
socket.on("delegation_progress", (ctx2) => {
|
|
@@ -2091,7 +2086,7 @@ var SocketController = class _SocketController {
|
|
|
2091
2086
|
1e4,
|
|
2092
2087
|
(result) => {
|
|
2093
2088
|
if (result.status === "success") {
|
|
2094
|
-
CadenzaService.log("Socket connected", {
|
|
2089
|
+
CadenzaService.log("Socket client connected", {
|
|
2095
2090
|
result,
|
|
2096
2091
|
serviceName,
|
|
2097
2092
|
socketId: socket?.id,
|
|
@@ -2127,6 +2122,7 @@ var SocketController = class _SocketController {
|
|
|
2127
2122
|
delete ctx2.__broadcast;
|
|
2128
2123
|
const requestSentAt = Date.now();
|
|
2129
2124
|
pendingDelegationIds.add(ctx2.__metadata.__deputyExecId);
|
|
2125
|
+
console.log("Delegating task:", ctx2.__remoteRoutineName);
|
|
2130
2126
|
emitWhenReady?.(
|
|
2131
2127
|
"delegation",
|
|
2132
2128
|
ctx2,
|
|
@@ -2135,6 +2131,12 @@ var SocketController = class _SocketController {
|
|
|
2135
2131
|
const requestDuration = Date.now() - requestSentAt;
|
|
2136
2132
|
const metadata = resultContext.__metadata;
|
|
2137
2133
|
delete resultContext.__metadata;
|
|
2134
|
+
console.log(
|
|
2135
|
+
"Delegation response received:",
|
|
2136
|
+
ctx2.__remoteRoutineName,
|
|
2137
|
+
"Duration:",
|
|
2138
|
+
requestDuration
|
|
2139
|
+
);
|
|
2138
2140
|
emit(
|
|
2139
2141
|
`meta.socket_client.delegated:${ctx2.__metadata.__deputyExecId}`,
|
|
2140
2142
|
{
|
|
@@ -2169,6 +2171,7 @@ var SocketController = class _SocketController {
|
|
|
2169
2171
|
}
|
|
2170
2172
|
return new Promise((resolve) => {
|
|
2171
2173
|
delete ctx2.__broadcast;
|
|
2174
|
+
console.log("Transmitting signal:", ctx2.__signalName);
|
|
2172
2175
|
emitWhenReady?.("signal", ctx2, 5e3, (response) => {
|
|
2173
2176
|
if (ctx2.__routineExecId) {
|
|
2174
2177
|
emit(
|
|
@@ -4244,8 +4247,9 @@ var GraphSyncController = class _GraphSyncController {
|
|
|
4244
4247
|
{ __syncing: true },
|
|
4245
4248
|
18e4
|
|
4246
4249
|
);
|
|
4247
|
-
CadenzaService.schedule("meta.sync_requested", { __syncing: true },
|
|
4250
|
+
CadenzaService.schedule("meta.sync_requested", { __syncing: true }, 5e3);
|
|
4248
4251
|
}
|
|
4252
|
+
console.log("Syncing initiated", this.isCadenzaDBReady);
|
|
4249
4253
|
}
|
|
4250
4254
|
};
|
|
4251
4255
|
|