Skip to content

watchmedo shell-command: drop events during execution of command #136

Closed
@jenisys

Description

@jenisys

(original title): watchmedo shell-command --wait seems to fire more often than necessary

Version: watchdog 0.6.0

When I execute the watchmedo script with "--wait --command=..." seems to be triggered to often. The command seems to be executed for each detected event according to the generated command-output. This seems to unnecessary and inefficient. Normally, I would expect the following behavior

# -- PSEUDO-CODE:
loop forever:
    Wait until event occurs.
    Remove all pending events (from the scheduler queue).
    Execute the command (once for all removed/pending events)

REASON:
When the command is executed it should rebuild whatever and be responsible for all accumulated events.

The efficient behaviour could also be enabled by a new, additional command-line option.

NOTE:
If you do not use the "--wait" option you can still use the nice debug/diag feature:

watchmedo shell-command ... --command='echo "${watch_src_path}"'

to detect which filesystem events occurred.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions