chore: stop treating dirs as having size 128 (#10750)
Resp. directories for the database, and both dirs and symlinks for `FileInfo.FileSize`. Instead handle it in the UI progress percentage. We even already have special cases there for deletions, might as well handle directories just like any other zero-sized needed item there. This went through the very thorough testing of running it on my laptop, the migration was applied and it seemed to be working fine after. --------- Signed-off-by: Simon Frei <freisim93@gmail.com>
This commit is contained in:
@@ -56,7 +56,8 @@ const (
|
||||
// DesiredPerFileBlocks is the number of blocks we aim for per file
|
||||
DesiredPerFileBlocks = 2000
|
||||
|
||||
SyntheticDirectorySize = 128
|
||||
// We used to send this size for directories and still accept that for compat.
|
||||
deprecatedSyntheticDirectorySize = 128
|
||||
|
||||
// don't bother compressing messages smaller than this many bytes
|
||||
compressionThreshold = 128
|
||||
@@ -640,7 +641,7 @@ func checkFileInfoConsistency(f FileInfo) error {
|
||||
// Only files should have blocks
|
||||
return errNonFileHasBlocks
|
||||
|
||||
case f.IsDirectory() && f.Size != 0 && f.Size != SyntheticDirectorySize:
|
||||
case f.IsDirectory() && f.Size != 0 && f.Size != deprecatedSyntheticDirectorySize:
|
||||
// Directories should be size zero or the synthetic directory size
|
||||
return errNonFileHasSize
|
||||
|
||||
|
||||
Reference in New Issue
Block a user