mirror of
https://github.com/expo/watchman.git
synced 2026-11-15 09:38:05 -10:00
Summary: adds `idle_reap_age_seconds` to .watchmanconfig and the global configuration. It defaults to 5 days. A watch is considered to be idle when it has had no filesystem notifications or commands that operate on it for idle_reap_age_seconds. If an idle watch has no triggers and no subscriptions then it will be cancelled, releasing the associated operating system resources, and removed from the state file. This is pretty straightforward in terms of implementation. I suspect the most difficult thing will be on agreeing to a decent value for the global default. I picked 5 days to allow for the reasonably common case where someone might be idle over a weekend and busy for the first couple of days in a week before they pick up where they left off. I suspect that the Ember folks would prefer to use a smaller value by default, so that their large number of discrete watches can be pruned more aggressively. I believe that desire will be largely mitigated once ember has migrated to use `watch-project`. Refs: https://github.com/facebook/watchman/issues/63 Test Plan: `make integration`. `tests/integration/test_age_watch.py` asserts that we won't reap while triggers or subscriptions are registered. I also manually tested this with a 300 second limit on a temporary dir and verified that the state file is correctly updated. Reviewers: sid0 Reviewed By: sid0 Subscribers: stefanpenner Differential Revision: https://reviews.facebook.net/D37701