mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 04:41:17 +08:00
vfs: error out early if can't upload 0 length file
Before this change if a backend can't upload 0 length files and `--vfs-cache-mode writes` was in use then the writeback logic would try to upload the 0 length file forever. This change causes it to exit on the first failure to upload.
This commit is contained in:
parent
ddaf01ece9
commit
168d577297
|
@ -593,6 +593,10 @@ func (item *Item) _store(ctx context.Context, storeFn StoreFn) (err error) {
|
|||
o, err := operations.Copy(ctx, item.c.fremote, o, name, cacheObj)
|
||||
item.mu.Lock()
|
||||
if err != nil {
|
||||
if errors.Is(err, fs.ErrorCantUploadEmptyFiles) {
|
||||
fs.Errorf(name, "Writeback failed: %v", err)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("vfs cache: failed to transfer file from cache to remote: %w", err)
|
||||
}
|
||||
item.o = o
|
||||
|
|
Loading…
Reference in New Issue
Block a user