Status (master branch)
This is a circus plugin to automatically restart a watcher if a FS change is observed (with inotify) inside the watcher workdir.
You can provide some inclusions and exclusions to avoid restart for changes on specific files/directories
with a gitignore
like syntax.
Add this to your circus
configuration:
[plugin:autorestart]
use = circus_autorestart_plugin.CircusAutorestartPlugin
To use this feature, your watcher must set (in its circus
configuration) a working_dir
with:
.autorestart_includes
- (and/or)
.autorestart_excludes
Both files follow gitignore
syntax even there are some specific limitations to the python wrapper used.
The plugin add inotify watches to every subdirectories of the configured working_dir
which don't
match with .autorestart_excludes
(if it exists). The working_dir
itself is always watched.
When a FS event is received, if the corresponding file matches .autorestart_includes
(if it exists) and not matches .autorestart_excludes
(if it exists), the watcher is killed (and
circus
should restart it).
At this moment:
- we just kill the watcher (
SIGKILL
) and we hope thancircus
will relaunch it (be careful if yourcircus
is not configured to do that). - if a new directory is created, it's not automatically watched itself.
- it seems that the
gitignore
parser used is not perfect.
See CONTRIBUTING.md file.
See CODE_OF_CONDUCT.md file.
(If you are officially paid to work on MetWork Framework, please contact us to add your company logo here!)