forked from TrueCloudLab/rclone
drive: fix server side copy of big files
Before this change rclone was sending a MimeType in the requests for server side Move and Copy. The conjecture is that if you attempt to set the MimeType to something different in a Copy then Google Drive has to do an actual copy of the file data. This takes a very long time (since it is large) and fails after a 90s timeout. After the change we no longer set the MimeType in Move or Copy and the copies happen instantly and correctly. Many thanks to @darthShadow for discovering that this was causing the problem. Fixes #3070 Fixes #3033 Fixes #3300 Fixes #3155
This commit is contained in:
parent
c9f77719e4
commit
5433021e8b
1 changed files with 2 additions and 1 deletions
|
@ -1649,7 +1649,6 @@ func (f *Fs) createFileInfo(ctx context.Context, remote string, modTime time.Tim
|
||||||
Name: leaf,
|
Name: leaf,
|
||||||
Description: leaf,
|
Description: leaf,
|
||||||
Parents: []string{directoryID},
|
Parents: []string{directoryID},
|
||||||
MimeType: fs.MimeTypeFromName(remote),
|
|
||||||
ModifiedTime: modTime.Format(timeFormatOut),
|
ModifiedTime: modTime.Format(timeFormatOut),
|
||||||
}
|
}
|
||||||
return createInfo, nil
|
return createInfo, nil
|
||||||
|
@ -1713,6 +1712,8 @@ func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo,
|
||||||
}
|
}
|
||||||
if importMimeType != "" {
|
if importMimeType != "" {
|
||||||
createInfo.MimeType = importMimeType
|
createInfo.MimeType = importMimeType
|
||||||
|
} else {
|
||||||
|
createInfo.MimeType = fs.MimeTypeFromName(remote)
|
||||||
}
|
}
|
||||||
|
|
||||||
var info *drive.File
|
var info *drive.File
|
||||||
|
|
Loading…
Add table
Reference in a new issue