check still open
This commit is contained in:
@@ -509,17 +509,20 @@ function connectRVS(forcePlain) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function sendToRVS(text, isPipeline) {
|
function sendToRVS(text, isPipeline) {
|
||||||
|
log("info", "rvs", `sendToRVS: rvsWs=${rvsWs ? 'exists' : 'null'}, readyState=${rvsWs ? rvsWs.readyState : 'N/A'}, OPEN=${WebSocket.OPEN}`);
|
||||||
if (!rvsWs || rvsWs.readyState !== WebSocket.OPEN) {
|
if (!rvsWs || rvsWs.readyState !== WebSocket.OPEN) {
|
||||||
log("error", "rvs", "Nicht verbunden");
|
log("error", "rvs", `Nicht verbunden (readyState: ${rvsWs ? rvsWs.readyState : 'null'})`);
|
||||||
if (isPipeline) pipelineEnd(false, "RVS nicht verbunden");
|
if (isPipeline) pipelineEnd(false, "RVS nicht verbunden");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
rvsWs.send(JSON.stringify({
|
const msg = JSON.stringify({
|
||||||
type: "chat",
|
type: "chat",
|
||||||
payload: { text, sender: "diagnostic" },
|
payload: { text, sender: "diagnostic" },
|
||||||
timestamp: Date.now(),
|
timestamp: Date.now(),
|
||||||
}));
|
});
|
||||||
|
log("info", "rvs", `Sende ${msg.length} bytes an RVS...`);
|
||||||
|
rvsWs.send(msg);
|
||||||
log("info", "rvs", `Gesendet via RVS: "${text}"`);
|
log("info", "rvs", `Gesendet via RVS: "${text}"`);
|
||||||
if (isPipeline) plog(`Nachricht an RVS gesendet — warte auf Antwort via RVS...`);
|
if (isPipeline) plog(`Nachricht an RVS gesendet — warte auf Antwort via RVS...`);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user