MCPcopy
hub / github.com/rclone/rclone / ExpireObject

Method ExpireObject

backend/cache/storage_persistent.go:429–436  ·  view source on GitHub ↗

ExpireObject will flush an Object and all its data if desired

(co *Object, withData bool)

Source from the content-addressed store, hash-verified

427
428// ExpireObject will flush an Object and all its data if desired
429func (b *Persistent) ExpireObject(co *Object, withData bool) error {
430 co.CacheTs = time.Now().Add(time.Duration(-co.CacheFs.opt.InfoAge))
431 err := b.AddObject(co)
432 if withData {
433 _ = os.RemoveAll(path.Join(b.dataPath, co.abs()))
434 }
435 return err
436}
437
438// HasEntry confirms the existence of a single entry (dir or object)
439func (b *Persistent) HasEntry(remote string) bool {

Callers 2

httpExpireRemoteMethod · 0.80
receiveChangeNotifyMethod · 0.80

Calls 5

AddObjectMethod · 0.95
JoinMethod · 0.80
AddMethod · 0.65
RemoveAllMethod · 0.65
absMethod · 0.45

Tested by

no test coverage detected