check still open
This commit is contained in:
parent
ecc3d59a8f
commit
7545c9c823
|
|
@ -509,17 +509,20 @@ function connectRVS(forcePlain) {
|
|||
}
|
||||
|
||||
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) {
|
||||
log("error", "rvs", "Nicht verbunden");
|
||||
log("error", "rvs", `Nicht verbunden (readyState: ${rvsWs ? rvsWs.readyState : 'null'})`);
|
||||
if (isPipeline) pipelineEnd(false, "RVS nicht verbunden");
|
||||
return false;
|
||||
}
|
||||
|
||||
rvsWs.send(JSON.stringify({
|
||||
const msg = JSON.stringify({
|
||||
type: "chat",
|
||||
payload: { text, sender: "diagnostic" },
|
||||
timestamp: Date.now(),
|
||||
}));
|
||||
});
|
||||
log("info", "rvs", `Sende ${msg.length} bytes an RVS...`);
|
||||
rvsWs.send(msg);
|
||||
log("info", "rvs", `Gesendet via RVS: "${text}"`);
|
||||
if (isPipeline) plog(`Nachricht an RVS gesendet — warte auf Antwort via RVS...`);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue