Skip to content

Commit eaf042e

Browse files
committed
fix: enforce minimum debounce of 10ms to prevent CPU exhaustion
1 parent cb9689d commit eaf042e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ impl Config {
384384
}
385385

386386
pub fn set_watch_debounce(&mut self, ms: u64) -> Result<()> {
387+
if ms < 10 {
388+
anyhow::bail!("Watch debounce must be at least 10ms");
389+
}
387390
self.watch_debounce_ms = ms;
388391
self.save()
389392
}

0 commit comments

Comments
 (0)