mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-23 03:33:15 +00:00
Add a Sync call before close when uploading a file to local storage
This commit is contained in:
@@ -190,7 +190,16 @@ func (storage *FileStorage) UploadFile(threadIndex int, filePath string, content
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = file.Sync()
|
||||||
|
if err != nil {
|
||||||
file.Close()
|
file.Close()
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = file.Close()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
err = os.Rename(temporaryFile, fullPath)
|
err = os.Rename(temporaryFile, fullPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user