Browse Source

Log when dropping inputs in daemon

tags/v0.2.0-candidate
Philipp Oppermann 3 years ago
parent
commit
2c80b6bcc2
Failed to extract signature
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      binaries/daemon/src/listener/mod.rs

+ 4
- 1
binaries/daemon/src/listener/mod.rs View File

@@ -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


Loading…
Cancel
Save