mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 09:32:29 +08:00
vfs: don't remove file from writers until it is transferred
This means that the list of active writers is up to date
This commit is contained in:
parent
1b22ee5b93
commit
321b6da7af
|
@ -143,7 +143,8 @@ func (fh *RWFileHandle) close() (err error) {
|
|||
fh.closed = true
|
||||
rdwrMode := fh.flags & accessModeMask
|
||||
if rdwrMode != os.O_RDONLY {
|
||||
fh.file.delWriter(fh)
|
||||
// leave writer open until file is transferred
|
||||
defer fh.file.delWriter(fh)
|
||||
}
|
||||
if !fh.opened {
|
||||
// If read only then return
|
||||
|
|
|
@ -151,7 +151,8 @@ func (fh *WriteFileHandle) close() error {
|
|||
return ECLOSED
|
||||
}
|
||||
fh.closed = true
|
||||
fh.file.delWriter(fh)
|
||||
// leave writer open until file is transferred
|
||||
defer fh.file.delWriter(fh)
|
||||
writeCloseErr := fh.pipeWriter.Close()
|
||||
err := <-fh.result
|
||||
if err == nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user