mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 10:13:52 +08:00
cache: improve performance by not sending info requests for cached chunks
This commit is contained in:
parent
2e37942592
commit
a4c4019032
10
backend/cache/object.go
vendored
10
backend/cache/object.go
vendored
|
@ -208,11 +208,17 @@ func (o *Object) SetModTime(t time.Time) error {
|
|||
|
||||
// Open is used to request a specific part of the file using fs.RangeOption
|
||||
func (o *Object) Open(options ...fs.OpenOption) (io.ReadCloser, error) {
|
||||
if err := o.refreshFromSource(true); err != nil {
|
||||
var err error
|
||||
|
||||
if o.Object == nil {
|
||||
err = o.refreshFromSource(true)
|
||||
} else {
|
||||
err = o.refresh()
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var err error
|
||||
cacheReader := NewObjectHandle(o, o.CacheFs)
|
||||
var offset, limit int64 = 0, -1
|
||||
for _, option := range options {
|
||||
|
|
Loading…
Reference in New Issue
Block a user