MCPcopy
hub / github.com/rclone/rclone / refresh

Method refresh

backend/cache/object.go:158–166  ·  view source on GitHub ↗

refresh will check if the object info is expired and request the info from source if it is all these conditions must be true to ignore a refresh 1. cache ts didn't expire yet 2. is not pending a notification from the wrapped fs

(ctx context.Context)

Source from the content-addressed store, hash-verified

156// 1. cache ts didn't expire yet
157// 2. is not pending a notification from the wrapped fs
158func (o *Object) refresh(ctx context.Context) error {
159 isNotified := o.CacheFs.isNotifiedRemote(o.Remote())
160 isExpired := time.Now().After(o.CacheTs.Add(time.Duration(o.CacheFs.opt.InfoAge)))
161 if !isExpired && !isNotified {
162 return nil
163 }
164
165 return o.refreshFromSource(ctx, true)
166}
167
168// refreshFromSource requests the original FS for the object in case it comes from a cached entry
169func (o *Object) refreshFromSource(ctx context.Context, force bool) error {

Callers 5

ModTimeMethod · 0.95
SizeMethod · 0.95
StorableMethod · 0.95
OpenMethod · 0.95
HashMethod · 0.95

Calls 4

RemoteMethod · 0.95
refreshFromSourceMethod · 0.95
isNotifiedRemoteMethod · 0.80
AddMethod · 0.65

Tested by

no test coverage detected