Merge pull request #225 from david415/2438.magic-folder-stable.8

Add comment about FUDGE_SECONDS and refer to our design doc
This commit is contained in:
Daira Hopwood 2016-01-23 00:41:04 +00:00
commit 6421cc235f
1 changed files with 4 additions and 0 deletions

View File

@ -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)