Skip to content

Commit f5d3677

Browse files
jmbergmatttbe
authored andcommitted
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 <johannes@sipsolutions.net>
1 parent 754997d commit f5d3677

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pw_upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def watch(self):
172172
raise Exception('Not initialized')
173173

174174
while not should_stop:
175-
for event in self.inotify.read(timeout=2):
175+
for event in self.inotify.read(timeout=2000):
176176
if event.mask & inotify.flags.IGNORED or \
177177
event.wd < 0 or \
178178
event.wd not in self.wd2name:

0 commit comments

Comments
 (0)