[run] Fix outdated comment in ExecHandler

This commit is contained in:
Félix Saparelli 2019-01-26 17:37:52 +13:00
parent 5846b64020
commit 578ffa1deb
1 changed files with 6 additions and 14 deletions

View File

@ -115,10 +115,6 @@ where
// Call handler initially, if necessary
if args.run_initially && !args.once {
if args.clear_screen {
clear_screen();
}
if !handler.on_manual()? {
return Ok(());
}
@ -129,10 +125,6 @@ where
let paths = wait_fs(&rx, &filter, args.debounce);
debug!("Paths updated: {:?}", paths);
if args.clear_screen {
clear_screen();
}
if !handler.on_update(&paths)? {
break;
}
@ -199,12 +191,12 @@ impl Handler for ExecHandler {
// Only returns Err() on lock poisoning.
fn on_update(&mut self, ops: &[PathOp]) -> Result<bool> {
// We have three scenarios here:
// We have four scenarios here:
//
// 1. Make sure the previous run was ended, then run the command again
// 2. Just send a specified signal to the child, do nothing more
// 3. Send SIGTERM to the child, wait for it to exit, then run the command again
// 4. Send a specified signal to the child, wait for it to exit, then run the command again
// 1. Send a specified signal to the child, wait for it to exit, then run the command again
// 2. Send SIGTERM to the child, wait for it to exit, then run the command again
// 3. Just send a specified signal to the child, do nothing more
// 4. Make sure the previous run was ended, then run the command again
//
let scenario = (self.args.restart, self.signal.is_some());
@ -251,7 +243,7 @@ pub fn run(args: Args) -> Result<()> {
}
fn wait_fs(rx: &Receiver<Event>, filter: &NotificationFilter, debounce: u64) -> Vec<PathOp> {
let mut paths = vec![];
let mut paths = Vec::new();
let mut cache = HashMap::new();
loop {