From 033ffe9254a6b3b8745283c87c0a07be012ca512 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 11 Feb 2026 08:56:55 +0100 Subject: [PATCH] pw_upload: wake up less frequently from inotify The timeout parameter for inotify.read() is specified in milliseconds, and therefore the thread is constantly waking up just to see if it should terminate. Change it to only do that every two seconds, as was (likely) intended. Addresses #68. Signed-off-by: Johannes Berg --- pw_upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pw_upload.py b/pw_upload.py index 78cede2..2d9882e 100755 --- a/pw_upload.py +++ b/pw_upload.py @@ -172,7 +172,7 @@ def watch(self): raise Exception('Not initialized') while not should_stop: - for event in self.inotify.read(timeout=2): + for event in self.inotify.read(timeout=2000): if event.mask & inotify.flags.IGNORED or \ event.wd < 0 or \ event.wd not in self.wd2name: