Skip to content

Commit 2a3f501

Browse files
committed
pw_upload: watch for MOVED_TO events
When uploading files with rsync we get MOVED_TO events instead of CREATE. rsync creates tmp files and swaps them into place. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c363f61 commit 2a3f501

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pw_upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def _handle_new_dir(self, name):
147147
return
148148

149149
# Install the watch, to avoid race conditions with the check
150-
wd = self.inotify.add_watch(path, inotify.flags.CREATE)
150+
wd = self.inotify.add_watch(path, inotify.flags.CREATE | inotify.flags.MOVED_TO)
151151
self.wd2name[wd] = name
152152
log(f"New watch: {wd} => {name}", '')
153153

0 commit comments

Comments
 (0)