mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-02 03:34:39 -06:00
Set file sizes to -1 before creating the file reader
This commit is contained in:
@@ -11,8 +11,9 @@ ${DUPLICACY} init integration-tests $TEST_STORAGE -c 4
|
|||||||
# Create 10 small files
|
# Create 10 small files
|
||||||
add_file file1 20
|
add_file file1 20
|
||||||
add_file file2 20
|
add_file file2 20
|
||||||
add_file file3 20
|
rm file3; touch file3
|
||||||
add_file file4 20
|
add_file file4 20
|
||||||
|
chmod u-r file4
|
||||||
add_file file5 20
|
add_file file5 20
|
||||||
add_file file6 20
|
add_file file6 20
|
||||||
add_file file7 20
|
add_file file7 20
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ backup
|
|||||||
add_file file3
|
add_file file3
|
||||||
backup
|
backup
|
||||||
add_file file4
|
add_file file4
|
||||||
|
chmod u-r ${TEST_REPO}/file4
|
||||||
backup
|
backup
|
||||||
add_file file5
|
add_file file5
|
||||||
restore
|
restore
|
||||||
|
|||||||
@@ -361,14 +361,16 @@ func (manager *BackupManager) Backup(top string, quickMode bool, threads int, ta
|
|||||||
var uploadedChunkLengths []int
|
var uploadedChunkLengths []int
|
||||||
var uploadedChunkLock = &sync.Mutex{}
|
var uploadedChunkLock = &sync.Mutex{}
|
||||||
|
|
||||||
// the file reader implements the Reader interface. When an EOF is encounter, it opens the next file unless it
|
// Set all file sizes to -1 to indicate they haven't been processed. This must be done before creating the file
|
||||||
// is the last file.
|
// reader because the file reader may skip inaccessible files on construction.
|
||||||
fileReader := CreateFileReader(shadowTop, modifiedEntries)
|
|
||||||
// Set all file sizes to -1 to indicate they haven't been processed
|
|
||||||
for _, entry := range modifiedEntries {
|
for _, entry := range modifiedEntries {
|
||||||
entry.Size = -1
|
entry.Size = -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the file reader implements the Reader interface. When an EOF is encounter, it opens the next file unless it
|
||||||
|
// is the last file.
|
||||||
|
fileReader := CreateFileReader(shadowTop, modifiedEntries)
|
||||||
|
|
||||||
startUploadingTime := time.Now().Unix()
|
startUploadingTime := time.Now().Unix()
|
||||||
|
|
||||||
lastUploadingTime := time.Now().Unix()
|
lastUploadingTime := time.Now().Unix()
|
||||||
|
|||||||
Reference in New Issue
Block a user