log ws close event
This commit is contained in:
parent
90f8bb67b3
commit
869efdd56a
@ -30,7 +30,8 @@ function setupUi() {
|
||||
}
|
||||
|
||||
function setupWs() {
|
||||
ws.onclose = function () {
|
||||
ws.onclose = function (e) {
|
||||
console.log(e);
|
||||
setTimeout(() => {
|
||||
ws = new WebSocket(wsUrl);
|
||||
}, 2000);
|
||||
|
@ -56,6 +56,8 @@ async fn handle_socket(stream: WebSocket, state: Arc<AppState>) {
|
||||
while let Some(Ok(Message::Text(text))) = receiver.next().await {
|
||||
if let Ok(action) = serde_json::from_str::<Action>(&text) {
|
||||
let client = action.client.clone();
|
||||
tracing::debug!("update from {}", client.clone());
|
||||
|
||||
action.execute(state.clone()).await;
|
||||
|
||||
let doc = state.doc.read().await;
|
||||
|
Loading…
Reference in New Issue
Block a user