From 4ecf968accd8f6b31fcfb1935507e7d65bb24e96 Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Fri, 19 Jul 2024 09:34:47 -0500 Subject: [PATCH] Very low interval times on the cake watcher were causing issues. The underlying data updates at the specified speed (with a server-side ringbuffer), so delay the update speed to maintain reasonable server load. --- .../node_manager/ws/single_user_channels/cake_watcher.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/rust/lqosd/src/node_manager/ws/single_user_channels/cake_watcher.rs b/src/rust/lqosd/src/node_manager/ws/single_user_channels/cake_watcher.rs index 5384bfdd..afa2d23f 100644 --- a/src/rust/lqosd/src/node_manager/ws/single_user_channels/cake_watcher.rs +++ b/src/rust/lqosd/src/node_manager/ws/single_user_channels/cake_watcher.rs @@ -1,16 +1,11 @@ use lqos_bus::QueueStoreTransit; -use lqos_config::load_config; use lqos_queue_tracker::{add_watched_queue, get_raw_circuit_data, still_watching}; pub(super) async fn cake_watcher(circuit_id: String, tx: tokio::sync::mpsc::Sender) { - let interval_ms = if let Ok(config) = load_config() { - config.queue_check_period_ms - } else { - 0 - }; + const INTERVAL_MS: u64 = 1000; add_watched_queue(&circuit_id); - let mut ticker = tokio::time::interval(tokio::time::Duration::from_millis(interval_ms)); + let mut ticker = tokio::time::interval(tokio::time::Duration::from_millis(INTERVAL_MS)); ticker.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Delay); loop { ticker.tick().await;