Fix demo for poll option gaining a timeout

This commit is contained in:
Félix Saparelli 2021-09-03 05:18:30 +12:00
parent ef453193af
commit 0f247e9e5c
No known key found for this signature in database
GPG Key ID: B948C4BAE44FC474
1 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,5 @@
use std::time::Duration;
use watchexec::{
action::{Action, Outcome},
config::{InitConfig, RuntimeConfig},
@ -47,7 +49,9 @@ async fn main() -> color_eyre::eyre::Result<()> {
w.reconfigure(config)?;
} else if sigs.iter().any(|sig| sig == &Signal::User2) {
eprintln!("Switching to polling for funsies");
config.file_watcher(Watcher::Poll).keep_action();
config
.file_watcher(Watcher::Poll(Duration::from_millis(50)))
.keep_action();
w.reconfigure(config)?;
} else {
action.outcome(Outcome::if_running(