Fix: Wait for send_task to be ready before executing start.bas
All checks were successful
BotServer CI / build (push) Successful in 15m19s

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-03-18 14:38:46 -03:00
parent 8f073a15fd
commit 6e594d68dd

View file

@ -1318,6 +1318,8 @@ async fn handle_websocket(
}
}
let (send_ready_tx, send_ready_rx) = tokio::sync::mpsc::channel::<()>(1);
// Execute start.bas automatically on connection (similar to auth.ast pattern)
{
let bot_name_result = {
@ -1445,8 +1447,6 @@ async fn handle_websocket(
}
}
let (send_ready_tx, mut send_ready_rx) = tokio::sync::mpsc::channel::<()>(1);
let mut send_task = tokio::spawn(async move {
while let Some(response) = rx.recv().await {
if let Ok(json_str) = serde_json::to_string(&response) {