fix change check for dirs

We recalculate the stored dir size for every dir to be the sum of all
ancestors, so comparing the dir size as reported by the file system will
usually always differ.
This commit is contained in:
ducklet 2023-02-21 21:32:48 +01:00
parent d995651487
commit 9720d75a61

View file

@ -408,7 +408,8 @@ def upsert_if_changed(
assert isinstance(row, Row) # Required for Mypy 1.0.0. assert isinstance(row, Row) # Required for Mypy 1.0.0.
is_changed = ( is_changed = (
new_data["stat_bytes"] != row.stat_bytes # For dirs we ignore the reported size, because we're not storing it as-is.
(new_data["stat_type"] != "d" and new_data["stat_bytes"] != row.stat_bytes)
# or new_data["stat_changed"] != row.stat_changed # Ignore ctime, mtime is enough # or new_data["stat_changed"] != row.stat_changed # Ignore ctime, mtime is enough
or new_data["stat_modified"] != row.stat_modified or new_data["stat_modified"] != row.stat_modified
or new_data["stat_type"] != row.stat_type or new_data["stat_type"] != row.stat_type