filewatcher: Delay for triggering

Hello!

filewatcher has an --interval option.

But it’s only for files check.

I have a problem: massive files changes by git (for example), when many-many files are changed, or added, or anything else, and in the same time filewatcher is working — it’s begin triggering shell command many-many times.

Using with --restart.

--interval doesn’t help.

We need for a code (or option) about trigger delay: for example, if any (watched) file has been changed — trigger shell command and wait 100–300 ms (for example) before next triggering.

Or, may be, don’t collect collection of changed files, and trigger only by first.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 24 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Yes, let’s do it!

@thomasfl I’d like to decide about the variables, maybe they need some changes with new behavior.

And today I thought of a slightly better scheme of work for --delay option, I’ll create a new PR.

I support this decision!

👍

I think the best way to tackle this is to do what a similar js cli tool called watch does:

    --wait=<seconds>
        Duration, in seconds, that watching will be disabled
        after running <command>. Setting this option will
        throttle calls to <command> for the specified duration.

https://github.com/mikeal/watch

@gisikw You’ve been engaged in the same problem recently. Any comments?

If we add a --wait option then the --dontwait option should probably be renamed to --immediate to avoid confusion.