changeset 4935:a6b0b1fcd463

fuid: keep same fake_mtime for intervals of max_staleness duration
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 04 Aug 2009 21:50:44 +0200
parents efd8087a3062
children 1c8da2f463ee d5d9ef80d39b
files MoinMoin/util/filesys.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/util/filesys.py	Tue Aug 04 08:43:58 2009 +0200
+++ b/MoinMoin/util/filesys.py	Tue Aug 04 21:50:44 2009 +0200
@@ -146,9 +146,11 @@
             # trick
             now = int(time.time())
             if now >= st.st_mtime + max_staleness:
-                fake_mtime = now
+                # keep same fake_mtime for each max_staleness interval
+                fake_mtime = int(now / max_staleness) * max_staleness
         uid = (st.st_mtime,  # might have a rather rough granularity, e.g. 2s
-                             # on FAT and might not change on fast updates
+                             # on FAT, 1s on ext3 and might not change on fast
+                             # updates
                st.st_ino,  # inode number (will change if the update is done
                            # by e.g. renaming a temp file to the real file).
                            # not supported on win32 (0 ever)