mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Further reduce logging noise
This commit is contained in:
@@ -122,7 +122,7 @@ impl Conduit {
|
|||||||
|
|
||||||
// Wire up on_open
|
// Wire up on_open
|
||||||
let onopen_callback = Closure::<dyn FnMut(_)>::new(move |_e: ErrorEvent| {
|
let onopen_callback = Closure::<dyn FnMut(_)>::new(move |_e: ErrorEvent| {
|
||||||
log("Open Received");
|
//log("Open Received");
|
||||||
on_open();
|
on_open();
|
||||||
});
|
});
|
||||||
socket.set_onopen(Some(onopen_callback.as_ref().unchecked_ref()));
|
socket.set_onopen(Some(onopen_callback.as_ref().unchecked_ref()));
|
||||||
@@ -130,7 +130,7 @@ impl Conduit {
|
|||||||
|
|
||||||
// Wire up on message
|
// Wire up on message
|
||||||
let onmessage_callback = Closure::<dyn FnMut(_)>::new(move |e: MessageEvent| {
|
let onmessage_callback = Closure::<dyn FnMut(_)>::new(move |e: MessageEvent| {
|
||||||
log("Message Received");
|
//log("Message Received");
|
||||||
if let Ok(abuf) = e.data().dyn_into::<js_sys::ArrayBuffer>() {
|
if let Ok(abuf) = e.data().dyn_into::<js_sys::ArrayBuffer>() {
|
||||||
let response = WsResponseMessage::from_array_buffer(abuf);
|
let response = WsResponseMessage::from_array_buffer(abuf);
|
||||||
match response {
|
match response {
|
||||||
@@ -180,13 +180,13 @@ impl Conduit {
|
|||||||
|
|
||||||
// Kill old messages, to avoid a flood on reconnect
|
// Kill old messages, to avoid a flood on reconnect
|
||||||
self.message_queue.retain(|msg| msg.submitted.elapsed().as_secs_f32() < 10.0);
|
self.message_queue.retain(|msg| msg.submitted.elapsed().as_secs_f32() < 10.0);
|
||||||
log(&format!("{} Enqueued Messages", self.message_queue.len()));
|
//log(&format!("{} Enqueued Messages", self.message_queue.len()));
|
||||||
|
|
||||||
// Send queued messages
|
// Send queued messages
|
||||||
if let Some(ws) = &mut self.socket {
|
if let Some(ws) = &mut self.socket {
|
||||||
while let Some(msg) = self.message_queue.pop_front() {
|
while let Some(msg) = self.message_queue.pop_front() {
|
||||||
let msg = msg.serialize();
|
let msg = msg.serialize();
|
||||||
log("Message Serialized");
|
//log("Message Serialized");
|
||||||
match msg {
|
match msg {
|
||||||
Ok(msg) => {
|
Ok(msg) => {
|
||||||
if let Err(e) = ws.send_with_u8_array(&msg) {
|
if let Err(e) = ws.send_with_u8_array(&msg) {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ extern "C" {
|
|||||||
pub use conduit::{initialize_wss, is_wasm_connected, send_wss_queue};
|
pub use conduit::{initialize_wss, is_wasm_connected, send_wss_queue};
|
||||||
|
|
||||||
fn send_message(msg: WasmRequest) {
|
fn send_message(msg: WasmRequest) {
|
||||||
log(&format!("Enqueueing message: {msg:?}"));
|
//log(&format!("Enqueueing message: {msg:?}"));
|
||||||
conduit::send_message(msg);
|
conduit::send_message(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user