From e475104cf28e60b5ed74eb4727033fa5269bd9a1 Mon Sep 17 00:00:00 2001 From: David Stainton Date: Mon, 18 Jan 2016 17:06:47 +0100 Subject: [PATCH] Add comment about FUDGE_SECONDS and refer to our design doc --- src/allmydata/frontends/magic_folder.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py index 5775514c..323e926f 100644 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@ -492,6 +492,10 @@ class WriteFileMixin(object): finally: os.umask(old_mask) + # FUDGE_SECONDS is used to determine if another process + # has written to the same file concurrently. This is described + # in the Earth Dragon section of our design document: + # docs/proposed/magic-folder/remote-to-local-sync.rst os.utime(replacement_path_u, (now, now - self.FUDGE_SECONDS)) if is_conflict: print "0x00 ------------ <><> is conflict; calling _rename_conflicted_file... %r %r" % (abspath_u, replacement_path_u) -- 2.37.2