From 2c80b6bcc243c463df1bb4c2148a03dcac8167d6 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 28 Feb 2023 14:50:07 +0100 Subject: [PATCH] Log when dropping inputs in daemon --- binaries/daemon/src/listener/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/binaries/daemon/src/listener/mod.rs b/binaries/daemon/src/listener/mod.rs index 7b3d6812..82a1f1d9 100644 --- a/binaries/daemon/src/listener/mod.rs +++ b/binaries/daemon/src/listener/mod.rs @@ -218,12 +218,15 @@ where .filter(|e| matches!(e, NodeEvent::Input { .. })) .count(); let drop_n = input_event_count.saturating_sub(self.max_queue_len); - self.drop_oldest_inputs(drop_n).await?; + if drop_n > 0 { + self.drop_oldest_inputs(drop_n).await?; + } } Ok(()) } async fn drop_oldest_inputs(&mut self, number: usize) -> Result<(), eyre::ErrReport> { + tracing::debug!("dropping {number} inputs because event queue is too full"); let mut drop_tokens = Vec::new(); for i in 0..number { // find index of oldest input event