combine: fix errors with backends shutting down while in use

Before this patch backends could be shutdown when they fell out of the
cache when they were in use with combine. This was particularly
noticeable with the dropbox backend which gave this error when
uploading files after the backend was Shutdown.

    Failed to copy: upload failed: batcher is shutting down

This patch gets the combine remote to pin them until it is finished.

See: https://forum.rclone.org/t/rclone-combine-upload-failed-batcher-is-shutting-down/32168
This commit is contained in:
Nick Craig-Wood 2022-08-03 17:15:59 +01:00
parent 2170376d1b
commit 821e084f28

View File

@ -145,6 +145,7 @@ func (f *Fs) newUpstream(ctx context.Context, dir, remote string) (*upstream, er
dir: dir, dir: dir,
pathAdjustment: newAdjustment(f.root, dir), pathAdjustment: newAdjustment(f.root, dir),
} }
cache.PinUntilFinalized(u.f, u)
return u, nil return u, nil
} }