vfs: add --vfs-read-wait and --vfs-write-wait flags

--vfs-read-wait duration    Time to wait for in-sequence read before seeking. (default 5ms)
    --vfs-write-wait duration   Time to wait for in-sequence write before giving error. (default 1s)

See: https://forum.rclone.org/t/constantly-high-iowait-add-log/14156
This commit is contained in:
Nick Craig-Wood
2020-02-04 10:56:00 +00:00
parent e3c11c9ca1
commit 393b94bb70
4 changed files with 12 additions and 4 deletions

View File

@@ -132,7 +132,8 @@ func (fh *WriteFileHandle) writeAt(p []byte, off int64) (n int, err error) {
}
if fh.offset != off {
// Set a background timer so we don't wait forever
timeout := time.NewTimer(10 * time.Second)
maxWait := fh.file.d.vfs.Opt.WriteWait
timeout := time.NewTimer(maxWait)
done := make(chan struct{})
abort := int32(0)
go func() {