From e7e8142d05799444a057e0588ad6adf7cb8d0c85 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Sat, 22 Feb 2025 20:55:20 +0800 Subject: [PATCH] watch necessary events only so that an overflow is less likely to happen. --- archrepo2/repomon.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/archrepo2/repomon.py b/archrepo2/repomon.py index 405f00c..f338bca 100755 --- a/archrepo2/repomon.py +++ b/archrepo2/repomon.py @@ -226,7 +226,9 @@ class EventHandler(pyinotify.ProcessEvent): p = os.path.join(d, f) if os.path.exists(p): # filter broken symlinks files.add(p) - wm.add_watch(d, pyinotify.ALL_EVENTS) + wm.add_watch(d, pyinotify.IN_CLOSE_WRITE | pyinotify.IN_DELETE | + pyinotify.IN_CREATE | pyinotify.IN_MOVED_FROM | + pyinotify.IN_MOVED_TO | pyinotify.IN_OPEN) self.repomans[d] = RepoMan(config, d, self) self.name = self.repomans[d].name self._auto_rename = self.repomans[d]._auto_rename